diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-30 15:52:15 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-30 15:52:15 +0000 |
commit | cd1f00780b2a412dcb01fcd5abd46df3a547e788 (patch) | |
tree | 4209039f3fab9b6bb73a652dac3b433006479b34 /vm_trace.c | |
parent | 3eb0620c2a901b12e6fb752fd1ae668ed8f2b918 (diff) |
merge revision(s) r46419,r46429: [Backport #9940]
* vm_trace.c: clear and restore recursive checking thread local data
to avoid unexpected throw from TracePoint.
[Bug #9940]
* test/ruby/test_settracefunc.rb: add a test.
* thread.c: adde
* rb_threadptr_reset_recursive_data(rb_thread_t *th);
* rb_threadptr_restore_recursive_data(rb_thread_t *th, VALUE old);
* vm_core.h: ditto.
* thread.c: added
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_trace.c b/vm_trace.c index 81452997e9..2047d5aec8 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -335,6 +335,7 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) { const VALUE errinfo = th->errinfo; const int outer_state = th->state; + const VALUE old_recursive = rb_threadptr_reset_recursive_data(th); int state = 0; th->state = 0; th->errinfo = Qnil; @@ -355,6 +356,7 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p) terminate: th->trace_arg = 0; th->vm->trace_running--; + rb_threadptr_restore_recursive_data(th, old_recursive); if (state) { if (pop_p) { |