summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-05 02:43:08 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-05 02:43:08 +0000
commit5cf363247595a43e58c919f11c5fc5883871b8a9 (patch)
tree4df1c04377c181df1cdca4dc1e1d0a0b182394d6 /test
parentf177c73edb16a62a3e1a06368ede687c5a5c53ff (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_optimization.rb8
1 files changed, 8 insertions, 0 deletions
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