[JuliaLowering] Fix try-finally token stack handling#61523
Closed
topolarity wants to merge 1 commit intoJuliaLang:masterfrom
Closed
[JuliaLowering] Fix try-finally token stack handling#61523topolarity wants to merge 1 commit intoJuliaLang:masterfrom
try-finally token stack handling#61523topolarity wants to merge 1 commit intoJuliaLang:masterfrom
Conversation
The token stack of the `handler` is just outside of the `try-finally` so we need to check if we jump to that level or higher.
Member
Author
|
Closing in favor of #61525 |
topolarity
pushed a commit
that referenced
this pull request
Apr 9, 2026
Alternative to #61523, fix JuliaLang/JuliaLowering.jl#171. Push to `ctx.handler_token_stack` before construction of the `FinallyHandler`, since the `JumpTarget` constructor needs it. The extra entry is ignored in `enter_finally_block`'s call to `emit_leave_handler`, but not in the one in `emit_break`. These changes should directly match flisp. I think we're still missing some `pop_exception`s compared to flisp, but wanted to get this PR up given the other one. As noted in the tests, I need to port #55876, which duplicates the finally block and only adds `pop_exception` to one copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The token stack of the
handleris just outside of thetry-finally, so the right logic is to check if we jump to that level or higher.We could probably use more test coverage for this code, but let's do a spot fix for now.
Resolves JuliaLang/JuliaLowering.jl#171.