diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-30 12:40:20 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-30 12:40:20 +0000 |
commit | bcdcee47381aa7314a6b249074078f8298d12c7a (patch) | |
tree | 7aa4d14162ae92ac7b32e739659b9b35994b41fb /test | |
parent | b33a168e65c64f2d852b3911e34bd4faab451ab8 (diff) |
merge revision(s) 66326,66649: [Backport #15385]
Fix infinite loop by ensure
* compile.c (iseq_insert_nop_between_end_and_cont): insert nop so that the end of rescue and continuing points are not same, to get rid of infinite loop. [Bug #15385]
test_optimization.rb: increase timeout for RubyCI
https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-trunk/log/20181230T040002Z.fail.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_optimization.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 6b08d07fe2..983054eafc 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -760,4 +760,13 @@ class TestRubyOptimization < Test::Unit::TestCase %w(1) || 2 while (i += 1) < 100 assert_equal(100, i) end + + def test_optimized_empty_ensure + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}", timeout: 10) + begin; + assert_raise(RuntimeError) { + begin raise ensure nil if nil end + } + end; + end end |