From 289dcb30b98688769644a9f000b577f96bd01594 Mon Sep 17 00:00:00 2001 From: ktsj Date: Sat, 23 Jun 2018 04:52:58 +0000 Subject: vm.c: fix infinite loop * vm.c: use EXEC_EVENT_HOOK_AND_POP_FRAME. While exception handling, if an exception is raised in hooks, need to pop current frame and raise this raised exception by hook. [ruby-dev:50582] [Bug #14865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index fe2201a30e..51e5268735 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -896,6 +896,21 @@ class TestSetTraceFunc < Test::Unit::TestCase end end + def test_tracepoint_exception_at_c_return + assert_nothing_raised(Timeout::Error, 'infinite trace') do + assert_normal_exit %q{ + begin + TracePoint.new(:c_return){|tp| + raise + }.enable{ + tap{ itself } + } + rescue + end + }, '', timeout: 3 + end + end + def test_tracepoint_with_multithreads assert_nothing_raised do TracePoint.new{ -- cgit v1.2.3