 +	/* FIXME: check that offset is at a valid instruction offset */
 +	if (uoffset >= size) {
 +	    rb_raise(rb_eTypeError, 
-+		     "instruction sequence offset %lu should be in the range -%l .. %lu",
++		     "instruction sequence offset %lu should be in the range -%lu .. %lu",
 +		     uoffset, size, size-1);
 +	}
 +	return uoffset;

+        /* rb_thread_method_and_id() wants a place to store a klass
+	    value which subsequently we will not use.  */
+        VALUE junk_klass; 
+        rb_thread_method_id_and_class(GET_THREAD(), &id, &junk_klass);
+	 /* When the event is RUBY_EVENT_RAISE, we have stored the raise
+	    message as the trace-hook klass parameter. */ 
+        klass = p->klass;
+    } else {
 	rb_thread_method_id_and_class(GET_THREAD(), &id, &klass);
     }

+      assert_equal Array, a.class
+      assert_equal RubyVM::InstructionSequence, iseq_hash.values[0][0].class
+    end
+  end
+
+  # Check RubyVM::InstructionSequence#arity
+  def test_arity
+    eval 'def five; 5 end'
+    eval 'def add(a,b); a+b end'
+    eval 'def splat(*a); 5 end'
+    [['five', 0,], ['add', 2], ['splat', -1]].each do |meth, expect|
+      assert_equal(expect, ISEQS__[meth][0].arity)
+    end
+  end
+end
Index: test/ruby/test_tracefunc_adds.rb
