Skip to content

Handle unrooted break jumps in Thread#7029

Merged
headius merged 2 commits intojruby:jruby-9.3from
headius:unrooted_break_in_thread
Jan 24, 2022
Merged

Handle unrooted break jumps in Thread#7029
headius merged 2 commits intojruby:jruby-9.3from
headius:unrooted_break_in_thread

Conversation

@headius
Copy link
Member

@headius headius commented Jan 24, 2022

This PR will fix #7009 by converting the IRBreakJump into a LocalJumpError before it bubbles completely out of the thread.

Initial attempt at this allows the jump to bubble all the way to the top of RubyRunnable before getting converted, which does not exactly match CRuby behavior. In CRuby, the jump is an LJE immediately because they search the current thread for the target scope and raise LJE immediately if it is not present. We do not want to add such a search to our break instruction.

This is later in the bubbling than CRuby handles it, but we do not
currently have a good way to know the break target does not exist
on the current thread.

Fixes jruby#7009
@headius headius added this to the JRuby 9.3.4.0 milestone Jan 24, 2022
@headius headius merged commit 1d6a80d into jruby:jruby-9.3 Jan 24, 2022
@headius headius deleted the unrooted_break_in_thread branch January 24, 2022 18:50
toy added a commit to toy/in_threads that referenced this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant