From 13e83d055ffba19d4db9ed56a80b8bfd849354fe Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 10 Dec 2012 06:23:44 +0000 Subject: vm_trace.c: exceptions in event hooks * vm_trace.c (rb_threadptr_exec_event_hooks): exceptions in event hooks should not propagate outside. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 6775b72b89..788253834e 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -798,4 +798,18 @@ class TestSetTraceFunc < Test::Unit::TestCase end } end + + def test_tracepoint_exception_at_line + assert_nothing_raised do + TracePoint.new(:line) {raise}.enable { + 1 + } + end + end + + def test_tracepoint_exception_at_return + assert_nothing_raised(Timeout::Error, 'infinite trace') do + assert_normal_exit('def m; end; TracePoint.new(:return) {raise}.enable {m}', '', timeout: 3) + end + end end -- cgit v1.2.3