mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 23:45:55 +02:00
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
This commit is contained in:
parent
c9b4b78085
commit
13e83d055f
4 changed files with 22 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue