summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-07 11:08:52 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-07 11:08:52 +0000
commit68260018df64bdb0ba88316ed47e47e53c6c0617 (patch)
treebaf6b20d34df6fca0bae83f7f41493933d49d0d4 /test
parent9bb27fa318928464f5ab66649a75bbd034307baa (diff)
* vm_args.c (vm_caller_setup_arg_block): disable symbol block
argument optimization when tail call optimization is enabled, in order to avoid SEGV. [ruby-core:76288] [Bug #12565] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_optimization.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index bbd468db6e..89a9753f0e 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -301,6 +301,21 @@ class TestRubyOptimization < Test::Unit::TestCase
assert_equal("should be rescued", result.message, bug12082)
end
+ def test_tailcall_symbol_block_arg
+ bug12565 = '[ruby-core:46065]'
+ tailcall(<<-EOF)
+ def apply_one_and_two(&block)
+ yield(1, 2)
+ end
+
+ def add_one_and_two
+ apply_one_and_two(&:+)
+ end
+ EOF
+ assert_equal(3, add_one_and_two,
+ message(bug12565) {disasm(:add_one_and_two)})
+ end
+
class Bug10557
def [](_)
block_given?