1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-11-07 00:39:56 +00:00
parent 6f4b9376b3
commit cf5ef3db5e
3 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Thu Nov 7 09:39:41 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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@ruby-lang.org>
* gc.c (gc_before_sweep): Change algorithm of malloc_limit to

View file

@ -991,4 +991,12 @@ class TestSetTraceFunc < Test::Unit::TestCase
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

View file

@ -294,6 +294,7 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p)
const int outer_state = th->state;
int state = 0;
th->state = 0;
th->errinfo = Qnil;
th->vm->trace_running++;
th->trace_arg = trace_arg;