summaryrefslogtreecommitdiff
path: root/test/ruby/test_optimization.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-06 15:14:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-06 15:14:22 +0000
commit51c602204072b18fd1625ac6bcec0bb8995c4b7d (patch)
treebd9eb4101071e6863fd8dfc036d515d367415f73 /test/ruby/test_optimization.rb
parent4488a4b9272509cd34dc365a9d46e0f86cffe8f9 (diff)
vm_insnhelper.c: blockparamproxy in rescue
* vm_insnhelper.c (vm_call_opt_block_call): get block handler from the method local frame. fix segfault at calling the proxy in rescue. http://twitter.com/wannabe53/status/970955247626567680 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_optimization.rb')
-rw-r--r--test/ruby/test_optimization.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index 2ef5b5e080..38da8b6c45 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -741,4 +741,16 @@ class TestRubyOptimization < Test::Unit::TestCase
end
assert_equal(:ok, obj.a())
end
+
+ def test_blockparam_in_rescue
+ obj = Object.new
+ def obj.foo(&b)
+ raise
+ rescue
+ b.call
+ end
+ result = nil
+ assert_equal(42, obj.foo {result = 42})
+ assert_equal(42, result)
+ end
end