From 13e83d055ffba19d4db9ed56a80b8bfd849354fe Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 10 Dec 2012 06:23:44 +0000 Subject: vm_trace.c: exceptions in event hooks * vm_trace.c (rb_threadptr_exec_event_hooks): exceptions in event hooks should not propagate outside. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index 160005220f..161c5d1528 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -286,14 +286,14 @@ rb_threadptr_exec_event_hooks(rb_trace_arg_t *targ) if (th->trace_running == 0 && targ->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) { const int vm_tracing = th->vm->trace_running; + const VALUE errinfo = th->errinfo; + const int outer_state = th->state; int state = 0; - int outer_state = th->state; th->state = 0; th->vm->trace_running = 1; th->trace_running = 1; { - const VALUE errinfo = th->errinfo; rb_hook_list_t *list; /* thread local traces */ @@ -309,15 +309,11 @@ rb_threadptr_exec_event_hooks(rb_trace_arg_t *targ) state = exec_hooks(th, list, targ, !vm_tracing); if (state) goto terminate; } - th->errinfo = errinfo; } terminate: + th->errinfo = errinfo; th->trace_running = 0; th->vm->trace_running = vm_tracing; - - if (state) { - TH_JUMP_TAG(th, state); - } th->state = outer_state; } } -- cgit v1.2.3