From 93df5a0a906587244feff91e2bc1eecb11e31d28 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 10 Apr 2015 08:29:30 +0000 Subject: * vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724] * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_settracefunc.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 58e927c217..1dcd2ccbee 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1332,4 +1332,24 @@ class TestSetTraceFunc < Test::Unit::TestCase } assert_equal [__LINE__ - 3, __LINE__ - 2], lines, 'Bug #10449' end + + class Bug10724 + def initialize + loop{return} + end + end + + def test_throwing_return_with_finish_frame + target_th = Thread.current + evs = [] + + TracePoint.new(:call, :return){|tp| + return if Thread.current != target_th + evs << tp.event + }.enable{ + a = Bug10724.new + } + + assert_equal([:call, :return], evs) + end end -- cgit v1.2.3