diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-21 04:31:19 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-21 04:31:19 +0000 |
commit | 39a65664265525fcd7ca23c5613f832b0889cd01 (patch) | |
tree | 08072d3b61bf0450c48a99fb8f5004f191ca9b0e /test | |
parent | e358e2f89964ed1950d64d040218cd80add26b72 (diff) |
merge revision(s) 50206: [Backport #10724]
* 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/branches/ruby_2_1@50576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_settracefunc.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 5cb6d4a16e..722228d0a1 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1348,4 +1348,24 @@ class TestSetTraceFunc < Test::Unit::TestCase } end 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 |