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

* eval.c (call_trace_func): remove the trace hook if any exception

raised.  [ruby-list:46515]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-11-06 02:01:36 +00:00
parent d10ef54c60
commit 3241664bc3
3 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Fri Nov 6 11:01:34 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (call_trace_func): remove the trace hook if any exception
raised. [ruby-list:46515]
Fri Nov 6 10:56:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (get_event_name): added thread events.

6
eval.c
View file

@ -2828,7 +2828,11 @@ call_trace_func(event, node, self, id, klass)
tracing = 0;
ruby_current_node = node_save;
SET_CURRENT_SOURCE();
if (state) JUMP_TAG(state);
if (state) {
trace_func = 0;
rb_remove_event_hook(call_trace_func);
JUMP_TAG(state);
}
}
static VALUE

View file

@ -135,4 +135,9 @@ class TestSetTraceFunc < Test::Unit::TestCase
assert_equal(["c-call", 131, :set_trace_func, Kernel], events.shift)
assert_equal([], events)
end
def test_bad_trace
e = Class.new(RuntimeError)
assert_raise(e) {set_trace_func proc{raise e}}
end
end