From 35c54a11b30342b3ffa72b476347c5b9998f2d79 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 May 2017 02:11:24 +0000 Subject: compile.c: fix catch-table labels optimization * compile.c (remove_unreachable_chunk): do not eliminate chunks followed by labels in catch-table entries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_optimization.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 910dc30c35..2d0eec02fd 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -567,4 +567,12 @@ class TestRubyOptimization < Test::Unit::TestCase assert_equal(:ok, t) end end + + def test_retry_label_in_unreachable_chunk + bug = '[ruby-core:81272] [Bug #13578]' + assert_valid_syntax("#{<<-"begin;"}\n#{<<-"end;"}", bug) + begin; + def t; if false; case 42; when s {}; end; end; end + end; + end end -- cgit v1.2.3