Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return prioritization 3rd try #1812

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

patrickbkr
Copy link
Member

Calling &return triggers a stack unwind which can cause code (e.g. in
LEAVE phasers) to run. That code can also call &return. The returns
conflict, if the later return unwinds over the return continuation
marker of the former return in the call stack, i.e. the LEAVE frame.
In such situations one wants the return to win that unwinds more of the
stack. This is the behavior implemented by this change. Previously the
later return always won.

This implements the behavior discussed in Raku/problem-solving#417.

Calling &return triggers a stack unwind which can cause code (e.g. in
`LEAVE` phasers) to run. That code can also call `&return`. The returns
conflict, if the later return unwinds over the return continuation
marker of the former return in the call stack, i.e. the `LEAVE` frame.
In such situations one wants the return to win that unwinds more of the
stack. This is the behavior implemented by this change. Previously the
later return always won.

This implements the behavior discussed in Raku/problem-solving#417.
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