Skip to content

Commit c58a603

Browse files
author
Ian Atol
committed
Correct miscounting due to in-place modification during lifting
1 parent e95d9ef commit c58a603

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

base/compiler/ssair/passes.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ function lift_arg!(
446446
end
447447
if isa(lifted, GlobalRef) || isa(lifted, Expr)
448448
lifted = insert_node!(compact, leaf, effect_free(NewInstruction(lifted, argextype(lifted, compact))))
449+
compact[leaf] = nothing
449450
stmt.args[argidx] = lifted
451+
compact[leaf] = stmt
450452
if isa(leaf, SSAValue) && leaf.id < compact.result_idx
451453
push!(compact.late_fixup, leaf.id)
452454
end
@@ -781,6 +783,7 @@ function sroa_pass!(ir::IRCode)
781783
continue
782784
end
783785
if !isempty(new_preserves)
786+
compact[idx] = nothing
784787
compact[idx] = form_new_preserves(stmt, preserved, new_preserves)
785788
end
786789
continue

0 commit comments

Comments
 (0)