diff --git a/base/compiler/ssair/slot2ssa.jl b/base/compiler/ssair/slot2ssa.jl index a5dd6a0fd8f29..3597f29e18bc4 100644 --- a/base/compiler/ssair/slot2ssa.jl +++ b/base/compiler/ssair/slot2ssa.jl @@ -129,16 +129,11 @@ function fixemup!(cond, rename, ir::IRCode, ci::CodeInfo, idx::Int, @nospecializ if isexpr(stmt, :isdefined) val = stmt.args[1] if isa(val, Union{SlotNumber, TypedSlot}) - slot = slot_id(val) - if (ci.slotflags[slot] & SLOT_USEDUNDEF) == 0 + ssa = rename(val) + if ssa === UNDEF_TOKEN + return false + elseif !isa(ssa, SSAValue) && !isa(ssa, NewSSAValue) return true - else - ssa = rename(val) - if ssa === UNDEF_TOKEN - return false - elseif !isa(ssa, SSAValue) && !isa(ssa, NewSSAValue) - return true - end end # temporarily corrupt the isdefined node. type_lift_pass! will fix it stmt.args[1] = ssa