diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-27 03:45:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-27 03:45:55 +0000 |
commit | 49160c7115077d57869c2996e2cfcfbc227bfc8c (patch) | |
tree | 3de46c053f2149c4b6ee420a7105816787895ae4 /test/ruby | |
parent | 978967b2e6a8f733355fc357d41ba135579b42f8 (diff) | |
download | ruby-49160c7115077d57869c2996e2cfcfbc227bfc8c.tar.gz |
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/trunk@59181 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 6955118de7..ecbf042e49 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1080,4 +1080,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 |