diff options
-rw-r--r-- | test/ruby/test_settracefunc.rb | 15 | ||||
-rw-r--r-- | version.h | 2 | ||||
-rw-r--r-- | vm.c | 8 |
3 files changed, 20 insertions, 5 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 0599ea2022..7453ecc4b9 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -857,6 +857,21 @@ class TestSetTraceFunc < Test::Unit::TestCase end end + def test_tracepoint_exception_at_c_return + assert_nothing_raised(Timeout::Error, 'infinite trace') do + assert_normal_exit %q{ + begin + TracePoint.new(:c_return){|tp| + raise + }.enable{ + tap{ itself } + } + rescue + end + }, '', timeout: 3 + end + end + def test_tracepoint_with_multithreads assert_nothing_raised do TracePoint.new{ @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.5" #define RUBY_RELEASE_DATE "2018-07-30" -#define RUBY_PATCHLEVEL 309 +#define RUBY_PATCHLEVEL 310 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 7 @@ -1797,10 +1797,10 @@ vm_exec(rb_thread_t *th) while (th->cfp->pc == 0 || th->cfp->iseq == 0) { if (UNLIKELY(VM_FRAME_TYPE(th->cfp) == VM_FRAME_MAGIC_CFUNC)) { - EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, th->cfp->self, - rb_vm_frame_method_entry(th->cfp)->def->original_id, - rb_vm_frame_method_entry(th->cfp)->called_id, - rb_vm_frame_method_entry(th->cfp)->owner, Qnil); + EXEC_EVENT_HOOK_AND_POP_FRAME(th, RUBY_EVENT_C_RETURN, th->cfp->self, + rb_vm_frame_method_entry(th->cfp)->def->original_id, + rb_vm_frame_method_entry(th->cfp)->called_id, + rb_vm_frame_method_entry(th->cfp)->owner, Qnil); RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, rb_vm_frame_method_entry(th->cfp)->owner, rb_vm_frame_method_entry(th->cfp)->def->original_id); |