Skip to content

break inside while loop will execute the ensure block outside of the while loop #6441

Description

@hoshiumiarata

It seems that break inside a while loop will execute the ensure block outside of the while loop.
For example:

begin
  while true
    puts 1
    break
  end
ensure
  puts 2
end

mruby (master) will output:

1
2
2

While Ruby 3.3 will output:

1
2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions