From b7fb705a1b3898937d623deda0d9c95f4f5bacd2 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Thu, 24 Oct 2024 20:08:16 +0900 Subject: [PATCH] inference: don't allow `SSAValue`s in assignment lhs 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. --- base/compiler/abstractinterpretation.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index dbe79e19bf9b4..777240adf581b 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -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