summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-10 06:23:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-10 06:23:44 +0000
commit13e83d055ffba19d4db9ed56a80b8bfd849354fe ()
tree5b8ab4f0854f25a9d3f72a332a667660761718db
parentc9b4b78085ee07fa6cae4a267fa5dff80d6351a4 (diff)
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
-rw-r--r--ChangeLog5
-rw-r--r--KNOWNBUGS.rb2
-rw-r--r--test/ruby/test_settracefunc.rb14
-rw-r--r--vm_trace.c10
4 files changed, 22 insertions, 9 deletions
@@ -1,3 +1,8 @@
Mon Dec 10 15:11:06 2012 Nobuyoshi Nakada <[email protected]>
* compile.c (iseq_compile_each): count flip-flop state in local iseq
@@ -3,5 +3,3 @@
# So all tests will cause failure.
#
-assert_equal('ok', "TracePoint.new(:line) {raise}.enable {\n 1\n}\n'ok'")
-assert_finish(3, 'def m; end; TracePoint.new(:return) {raise}.enable {m}')
@@ -798,4 +798,18 @@ class TestSetTraceFunc < Test::Unit::TestCase
end
}
end
end
@@ -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;
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->trace_running = 0;
th->vm->trace_running = vm_tracing;
-
- if (state) {
- TH_JUMP_TAG(th, state);
- }
th->state = outer_state;
}
}