Actions
Bug #10775
closed"break" from a block with nested begin-rescue became impossible
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-23 trunk 49389) [x86_64-darwin14]
Description
"break" from a block with nested begin-rescue became impossible.
Example(it is valid on Ruby 2.2.0, 2.1.5):
2.times do
begin
raise
rescue
begin
raise
rescue
break
end
end
end
Output:
test.rb:8:in `rescue in rescue in block in <main>': break from proc-closure (LocalJumpError)
from test.rb:5:in `rescue in block in <main>'
from test.rb:2:in `block in <main>'
from test.rb:1:in `each'
from test.rb:1:in `<main>'
I wrote test and fix on GitHub. Please see the pull request.
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Description updated (diff)
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset r49390.
vm_insnhelper.c: break from nested rescue
- vm_insnhelper.c (vm_throw_start): search the target to break
from a block with nested rescue, from the nested blocks.
[ruby-core:67765] [Bug #10775] [Fix GH-820]
Updated by nobu (Nobuyoshi Nakada) about 9 years ago
- Has duplicate Bug #11108: Unexpected LocalJumpError from "break" in nested begin block added
Updated by nobu (Nobuyoshi Nakada) about 9 years ago
- Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED
Updated by nagachika (Tomoyuki Chikanaga) about 9 years ago
- Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
Backported into ruby_2_2
branch at r50563.
Actions
Like0
Like0Like0Like0Like0Like0