diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-20 02:11:24 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-20 02:11:24 +0000 |
commit | 35c54a11b30342b3ffa72b476347c5b9998f2d79 (patch) | |
tree | bd1dea94fc7b39ba9927618044418657f367ee1d /test | |
parent | 68354c350a278a565bc3b2b3ba793b8a9dcd2712 (diff) | |
download | ruby-35c54a11b30342b3ffa72b476347c5b9998f2d79.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_optimization.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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 |