summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2024-09-02 03:10:19 -0700
committerTakashi Kokubun <[email protected]>2024-09-02 03:10:19 -0700
commitd83b5633b16f4ddcece4ff924f21c5a5851470cf (patch)
treebad0ccf9803c0ee2fc85752d5404793cc0e7dbc4 /test
parentb210c86a0201f6a97c4da8266908260746f53ae0 (diff)
merge revision(s) 992596fb7af18a7f472589a607d0eb3fbb03b49a: [Backport #20344]
Fix next inside block argument stack underflow [Bug #20344] Fix compile_next adding removable adjust label
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_iseq.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb
index dc9ef17ffe..27bb12c8d7 100644
--- a/test/ruby/test_iseq.rb
+++ b/test/ruby/test_iseq.rb
@@ -795,6 +795,27 @@ class TestISeq < Test::Unit::TestCase
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
+
def test_loading_kwargs_memory_leak
assert_no_memory_leak([], "#{<<~"begin;"}", "#{<<~'end;'}", rss: true)
a = RubyVM::InstructionSequence.compile("foo(bar: :baz)").to_binary