From 5cf363247595a43e58c919f11c5fc5883871b8a9 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 5 Aug 2017 02:43:08 +0000 Subject: merge revision(s) 58810,58894: [Backport #13578] compile.c: fix catch-table labels optimization * compile.c (remove_unreachable_chunk): do not eliminate chunks followed by labels in catch-table entries. compile.c: fix possible use of uninitialized value LABEL::unremovable added by r58810 is not initialized by new_label_body(), making the optimization unstable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_optimization.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 1ac02ec7e5..eebbc45e57 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -533,4 +533,12 @@ EOS 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