ruby-changes:31482
From: nobu <ko1@a...>
Date: Thu, 7 Nov 2013 09:40:03 +0900 (JST)
Subject: [ruby-changes:31482] nobu:r43561 (trunk): vm_trace.c: isolate errinfo in trace blocks
nobu 2013-11-07 09:39:56 +0900 (Thu, 07 Nov 2013) New Revision: 43561 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43561 Log: vm_trace.c: isolate errinfo in trace blocks * vm_trace.c (rb_threadptr_exec_event_hooks_orig): errinfo should not be propagated to trace blocks so that no argument raise does not throw internal objects. [ruby-dev:47793] [Bug #9088] Modified files: trunk/ChangeLog trunk/test/ruby/test_settracefunc.rb trunk/vm_trace.c Index: ChangeLog =================================================================== --- ChangeLog (revision 43560) +++ ChangeLog (revision 43561) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Nov 7 09:39:41 2013 Nobuyoshi Nakada <nobu@r...> + + * vm_trace.c (rb_threadptr_exec_event_hooks_orig): errinfo should not + be propagated to trace blocks so that no argument raise does not + throw internal objects. [ruby-dev:47793] [Bug #9088] + Wed Nov 6 21:30:55 2013 Masaya Tarui <tarui@r...> * gc.c (gc_before_sweep): Change algorithm of malloc_limit to Index: vm_trace.c =================================================================== --- vm_trace.c (revision 43560) +++ vm_trace.c (revision 43561) @@ -294,6 +294,7 @@ rb_threadptr_exec_event_hooks_orig(rb_tr https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L294 const int outer_state = th->state; int state = 0; th->state = 0; + th->errinfo = Qnil; th->vm->trace_running++; th->trace_arg = trace_arg; Index: test/ruby/test_settracefunc.rb =================================================================== --- test/ruby/test_settracefunc.rb (revision 43560) +++ test/ruby/test_settracefunc.rb (revision 43561) @@ -991,4 +991,12 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L991 assert_equal 9, n end + + def test_isolated_raise_in_trace + bug9088 = '[ruby-dev:47793] [Bug #9088]' + assert_ruby_status([], <<-END, bug9088) + set_trace_func proc {raise rescue nil} + 1.times {break} + END + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/