From f296c260ef3b2d1a9299dbb4a84df567972453f2 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 4 Jul 2019 13:47:43 -0700 Subject: Fix segfault when using method reference operator without using result Fixes [Bug #15985] --- test/ruby/test_syntax.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 7d99c233fd..18546efe63 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -93,6 +93,13 @@ class TestSyntax < Test::Unit::TestCase assert_valid_syntax("tap (proc do end)", __FILE__, bug9726) end + def test_methodref_literal + assert_separately [], <<-EOS + eval 'nil.:|;1' + 1000.times{eval 'nil.:|;1'} + EOS + end + def test_normal_argument assert_valid_syntax('def foo(x) end') assert_syntax_error('def foo(X) end', /constant/) -- cgit v1.2.3