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

* vm_trace.c (rb_threadptr_exec_event_hooks_orig): pop tag before

JUMP_TAG() if frame is `finish' frame.
  Without this patch, there is an inconsistency between control
  frame stack and tags stack.
  [Bug #7668]
* test/ruby/test_settracefunc.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2013-01-07 06:24:46 +00:00
parent 6e4b187bfe
commit b8e6fd6ffe
3 changed files with 32 additions and 1 deletions

View file

@ -1,3 +1,13 @@
Mon Jan 7 15:24:10 2013 Koichi Sasada <ko1@atdot.net>
* vm_trace.c (rb_threadptr_exec_event_hooks_orig): pop tag before
JUMP_TAG() if frame is `finish' frame.
Without this patch, there is an inconsistency between control
frame stack and tags stack.
[Bug #7668]
* test/ruby/test_settracefunc.rb: add a test for above.
Mon Jan 7 15:21:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
* Makefile.in, common.mk (fake, yes-fake, no-make): these dependecies

View file

@ -870,5 +870,21 @@ class TestSetTraceFunc < Test::Unit::TestCase
m1_test_trace_point_at_return_when_exception
end
end
bug_7668 = '[Bug #7668]'
ary = []
trace = TracePoint.new{|tp|
ary << tp.event
raise
}
begin
trace.enable{
1.times{
raise
}
}
rescue
assert_equal([:b_call, :b_return], ary, bug_7668)
end
end
end

View file

@ -316,7 +316,12 @@ rb_threadptr_exec_event_hooks_orig(rb_trace_arg_t *trace_arg, int pop_p)
th->vm->trace_running--;
if (state) {
if (pop_p) th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
if (pop_p) {
if (VM_FRAME_TYPE_FINISH_P(th->cfp)) {
th->tag = th->tag->prev;
}
th->cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
}
TH_JUMP_TAG(th, state);
}
th->state = outer_state;