Skip to content

Commit

Permalink
inference: don't allow SSAValues in assignment lhs (#56314)
Browse files Browse the repository at this point in the history
In `InferenceState` the lhs of a `:=` expression should only contain
`GlobalRef` or `SlotNumber` and no other IR elements. Currently when
`SSAValue` appears in `lhs`, the invalid assignment effect is somehow
ignored, but this is incorrect anyway, so this commit removes that
check. Since `SSAValue` should not appear in `lhs` in the first place,
this is not a significant change though.
  • Loading branch information
aviatesk authored Oct 25, 2024
1 parent 29b509d commit e8aacbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3648,7 +3648,7 @@ function typeinf_local(interp::AbstractInterpreter, frame::InferenceState, nextr
changes = StateUpdate(lhs, VarState(rt, false))
elseif isa(lhs, GlobalRef)
handle_global_assignment!(interp, frame, lhs, rt)
elseif !isa(lhs, SSAValue)
else
merge_effects!(interp, frame, EFFECTS_UNKNOWN)
end
end
Expand Down

0 comments on commit e8aacbf

Please sign in to comment.