diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-09 10:14:33 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-09 10:14:33 +0000 |
commit | 1a150fe07f0bcca02b8cf2ecd22453c0c6badcb5 (patch) | |
tree | fe04e463d6514d4a28b8c4380f502a9b1c2ec687 /test | |
parent | 048a82a99dc919b4a2027ee7f1141655b1d0f6a0 (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_3@59543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 165f679e76..90ed39de2a 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -905,4 +905,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 |