From 21c708ee802e1a59901eccc6448e40e8f72189b8 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 18 Aug 2024 18:07:14 +0900 Subject: merge revision(s) 992596fb7af18a7f472589a607d0eb3fbb03b49a: [Backport #20344] Fix next inside block argument stack underflow [Bug #20344] Fix compile_next adding removable adjust label --- test/ruby/test_iseq.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index c1de8c96de..f5147831e4 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -781,4 +781,25 @@ class TestISeq < Test::Unit::TestCase end end; end + + def test_unreachable_next_in_block + bug20344 = '[ruby-core:117210] [Bug #20344]' + assert_nothing_raised(SyntaxError, bug20344) do + compile(<<~RUBY) + proc do + next + + case nil + when "a" + next + when "b" + when "c" + proc {} + end + + next + end + RUBY + end + end end -- cgit v1.2.3