aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ir_ssa.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-04-11 22:49:19 +0200
committerlemon <lsof@mailbox.org>2026-04-11 22:49:19 +0200
commitd40371b615b560d8726fd4fdaf7d35abc959e0e9 (patch)
tree6e302f213c3e44fecccc032e79ea9f2d13c5c177 /src/ir_ssa.c
parent757b5735f44e9a9454f12612ec00c38d81f5f32c (diff)
backend: fix memory leak from not calling deluses() after replcuses in some places
Diffstat (limited to 'src/ir_ssa.c')
-rw-r--r--src/ir_ssa.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ir_ssa.c b/src/ir_ssa.c
index a1d960f..77474b5 100644
--- a/src/ir_ssa.c
+++ b/src/ir_ssa.c
@@ -14,11 +14,8 @@ copyopt(Function *fn)
for (int j = 1; j < blk->npred; ++j) {
if (arg[j].bits != arg->bits) goto Next;
}
- /* being conservative here because phis could have circular dependencies? */
- if (arg->t != RTMP || instrtab[arg->i].op != Ophi) {
- replcuses(mkref(RTMP, phi), *arg);
- delphi(blk, i--);
- }
+ replcuses(mkref(RTMP, phi), *arg);
+ delphi(blk, i--);
Next:;
}
for (int i = 0; i < blk->ins.n; ++i) {