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

codegen: manually restore ct->scope when no exception handler is emitted #56612

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

topolarity
Copy link
Member

@topolarity topolarity commented Nov 19, 2024

This fixes a bug introduced by #55907, which was neglecting that it's possible for EnterNode to have no catch destination and still have a scope.

This can especially happen if the compiler has decided that the body is nothrow and chooses to optimize away the catch destination, but also #55907 intended to make the scope-only form of :enter legal (and not need an exception handler) even if the body is not nothrow.

This fixes all that up to restore the scope correctly on the happy path.

Needs tests - will add those soon

@thofma
Copy link
Contributor

thofma commented Nov 19, 2024

(will close #56609)

…itted

This fixes a bug introduced by JuliaLang#55907, which was neglecting that it's possible
for `Expr(:enter, ...)` to have no `catch` destination and still have a scope,
especially if the compiler has decided that the body is `nothrow` and chooses
to optimize away the `catch` destination.
@topolarity topolarity merged commit 83ef55d into JuliaLang:master Nov 19, 2024
4 of 7 checks passed
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.

TypeError: in typeassert, expected Union{Nothing, Base.ScopedValues.Scope}
3 participants