diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-03 15:40:10 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-03 15:40:10 +0000 |
commit | 47a357424198aec757162a1b18233eafa28e4af2 (patch) | |
tree | 038ba7e0f649ee874269ad2a01a7ba6a2868053e /test/ruby | |
parent | 9b586688074a127cf51d162c3de6eb262488f132 (diff) |
merge revision(s) 59181: [Backport #13680]
vm_insnhelper.c: break in once
* vm_insnhelper.c (vm_throw_start): size of catch table has been
included in iseq_catch_table struct, which could be NULL, since
2.2. e.g., proc-closure in `once'.
[ruby-core:81775] [Bug #13680]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_exception.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index a6b707bcca..1a5f31ff0d 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1019,4 +1019,15 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| } end; end + + def test_break_in_once + assert_separately([], "#{<<-"begin;"}\n#{<<~'end;'}") + begin; + obj = Object.new + def obj.try + /#{break}/o + end + assert_raise(LocalJumpError, /proc-closure/) {obj.try} + end; + end end |