ruby-changes:32060
From: ko1 <ko1@a...>
Date: Wed, 11 Dec 2013 16:53:23 +0900 (JST)
Subject: [ruby-changes:32060] ko1:r44139 (trunk): * eval.c (rb_raise_jump): call c_return hook immediately after
ko1 2013-12-11 16:53:16 +0900 (Wed, 11 Dec 2013) New Revision: 44139 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44139 Log: * eval.c (rb_raise_jump): call c_return hook immediately after popping `raise' frame. Patches by deivid (David Rodriguez). [Bug #8886] * test/ruby/test_settracefunc.rb: catch up this fix. Modified files: trunk/ChangeLog trunk/eval.c trunk/test/ruby/test_settracefunc.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 44138) +++ ChangeLog (revision 44139) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Dec 11 16:45:58 2013 Koichi Sasada <ko1@a...> + + * eval.c (rb_raise_jump): call c_return hook immediately after + popping `raise' frame. + Patches by deivid (David Rodriguez). [Bug #8886] + + * test/ruby/test_settracefunc.rb: catch up this fix. + Wed Dec 11 16:01:26 2013 Nobuyoshi Nakada <nobu@r...> * hash.c (rb_hash_reject): return a plain hash, without copying Index: eval.c =================================================================== --- eval.c (revision 44138) +++ eval.c (revision 44139) @@ -689,10 +689,10 @@ rb_raise_jump(VALUE mesg) https://github.com/ruby/ruby/blob/trunk/eval.c#L689 ID mid = cfp->me->called_id; th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp); + EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil); setup_exception(th, TAG_RAISE, mesg); - EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, self, mid, klass, Qnil); rb_thread_raised_clear(th); JUMP_TAG(TAG_RAISE); } Index: test/ruby/test_settracefunc.rb =================================================================== --- test/ruby/test_settracefunc.rb (revision 44138) +++ test/ruby/test_settracefunc.rb (revision 44139) @@ -253,14 +253,14 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L253 events.shift) assert_equal(["c-return", 5, :exception, Exception], events.shift) + assert_equal(["c-return", 5, :raise, Kernel], + events.shift) assert_equal(["c-call", 5, :backtrace, Exception], events.shift) assert_equal(["c-return", 5, :backtrace, Exception], events.shift) assert_equal(["raise", 5, :test_raise, TestSetTraceFunc], events.shift) - assert_equal(["c-return", 5, :raise, Kernel], - events.shift) assert_equal(["c-call", 6, :===, Module], events.shift) assert_equal(["c-return", 6, :===, Module], @@ -515,10 +515,10 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L515 [:c_call, 20, "xyzzy", Exception, :initialize, raised_exc, :outer, :nothing], [:c_return,20, "xyzzy", Exception, :initialize, raised_exc, :outer, raised_exc], [:c_return,20, "xyzzy", Exception, :exception, RuntimeError, :outer, raised_exc], + [:c_return,20, "xyzzy", Kernel, :raise, self, :outer, nil], [:c_call, 20, "xyzzy", Exception, :backtrace, raised_exc, :outer, :nothing], [:c_return,20, "xyzzy", Exception, :backtrace, raised_exc, :outer, nil], [:raise, 20, "xyzzy", TestSetTraceFunc, :trace_by_tracepoint, self, :outer, raised_exc], - [:c_return,20, "xyzzy", Kernel, :raise, self, :outer, nil], [:c_call, 20, "xyzzy", Module, :===, RuntimeError,:outer, :nothing], [:c_return,20, "xyzzy", Module, :===, RuntimeError,:outer, true], [:line, 21, "xyzzy", TestSetTraceFunc, method, self, :outer, :nothing], -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/