  
  	if (iseq->insn_info_table[0].position == pos) goto found;
  	for (i = 1; i < iseq->insn_info_size; i++) {
-@@ -1164,8 +1165,20 @@
- 
- 	while (th->cfp->pc == 0 || th->cfp->iseq == 0) {
- 	    if (UNLIKELY(VM_FRAME_TYPE(th->cfp) == VM_FRAME_MAGIC_CFUNC)) {
--		const rb_method_entry_t *me = th->cfp->me;
--		EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, th->cfp->self, me->called_id, me->klass);
-+		/* rocky: The below tests and assignments are not
-+		   quite right.  The problem I am having is when a
-+		   there is an exception in hook code raised from a C
-+		   return event. This causes the below EXEC_EVENT_HOOK to
-+		   loop indefinitely. The below has the bad effect of
-+		   not reseting exec_event_tracing sometimes.
-+		 */
-+		if (0 == th->tracing && 0 == th->exec_event_tracing) {
-+		    const rb_method_entry_t *me = th->cfp->me;
-+		    th->exec_event_tracing = 1;
-+		    EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, th->cfp->self, 
-+				    me->called_id, me->klass);
-+		    th->exec_event_tracing = 0;
-+		}
- 	    }
- 	    th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
- 	}
-@@ -1333,7 +1346,7 @@
- 
- 	    switch (VM_FRAME_TYPE(th->cfp)) {
- 	      case VM_FRAME_MAGIC_METHOD:
--		EXEC_EVENT_HOOK(th, RUBY_EVENT_RETURN, th->cfp->self, 0, 0);
-+		EXEC_EVENT_RETURN_HOOK(th, RUBY_EVENT_RETURN, th->cfp->self, 0, 0);
- 		break;
- 	      case VM_FRAME_MAGIC_CLASS:
- 		EXEC_EVENT_HOOK(th, RUBY_EVENT_END, th->cfp->self, 0, 0);
 Index: vm_insnhelper.c
 ===================================================================
 --- vm_insnhelper.c	(revision 28682)

 	rb_thread_method_id_and_class(GET_THREAD(), &id, &klass);
     }
     if (id == ID_ALLOCATOR)
@@ -4234,9 +4337,11 @@
     rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
 
     /* trace */

+    rb_event_flag_t event_flags;
+    int tracing;  /* 0 if not tracing. If less than 0, skip that many
+		     C call/return pairs */
+
+    /* misc */
+    int method_missing_reason;
