mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
simple rescue+while+break should not use throw
609de71f04
fixes the issue by using
`throw` insn if `ensure` is used. However, that patch introduce
additional `throw` even if it is not needed. This patch solves
the issue.
This issue is pointed by @mame.
This commit is contained in:
parent
59b327aa58
commit
817764bd82
Notes:
git
2021-05-21 18:12:40 +09:00
2 changed files with 18 additions and 5 deletions
|
@ -104,6 +104,17 @@ class TestException < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
iseq = RubyVM::InstructionSequence.compile(<<-RUBY)
|
||||
begin
|
||||
while true
|
||||
break
|
||||
end
|
||||
rescue
|
||||
end
|
||||
RUBY
|
||||
|
||||
assert_equal false, iseq.to_a[13].any?{|(e,_)| e == :throw}
|
||||
end
|
||||
|
||||
def test_exception_in_ensure_with_redo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue