-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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: Restore ct->scope
in jl_eh_restore_state
#55907
Conversation
This eliminates the need to associate a `catch` with every `with(...) do ... end` block, which was really just acting as a landing pad to restore `jl_current_task->scope` in the majority of cases. This change does not actually update lowering to remove the unnecessary `catch` block - that's left as a follow-up.
b01d1d1
to
c5dc41f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sensible to me.
Since yesterday we see the following error in our nightly CI (see thofma/Hecke.jl#1687): TypeError: in typeassert, expected Union{Nothing, Base.ScopedValues.Scope}, got a value of type ZZRingElem
Stacktrace:
[1] get
@ ./scopedvalues.jl:152 [inlined]
[2] _precision_with_base_2
@ ./mpfr.jl:1041 [inlined]
[3] BigFloat
@ ./mpfr.jl:150 [inlined]
[4] _arf_get_mpfr(t::Nemo.arf_struct, ::RoundingMode{:Nearest})
@ Nemo ~/.julia/packages/Nemo/0TzOv/src/arb/arb.jl:129
[...] From the set of changes since this appeared I assume this is due to this PR, but I am not sure if this PR is faulty or just brings already existing misusage of cc @thofma |
@thofma reported to see TypeError: in typeassert, expected Union{Nothing, Base.ScopedValues.Scope}, got a value of type Tuple{Base.MP
FR.MPFRRoundingMode} which seems to be unrelated to any So this seems to be a genuine issue with this PR. |
…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.
Thanks for the heads up @lgoettgens, just opened #56612 to hopefully fix the regression |
…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.
…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.
…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.
…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.
…itted (#56612) 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~~
This eliminates the need to associate a
catch
with everywith(...) do ... end
block, which was really just acting as a landing pad to restorejl_current_task->scope
in the majority of cases.This change does not actually update lowering to remove the unnecessary
catch
block - that's left as a follow-up.