aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-03-19 21:42:42 +0100
committerlemon <lsof@mailbox.org>2026-03-19 22:09:08 +0100
commitfdbe13a0e9fe866310ec198fec43172ccad89106 (patch)
treecf5d02b6f4336c4d92178dbba0512f6057dc2141
parent243e4e6b1540dce0024ae2b6952acb969369b5be (diff)
c: fix isboollike() for phis
-rw-r--r--src/c.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/c.c b/src/c.c
index c8a040b..e7f902e 100644
--- a/src/c.c
+++ b/src/c.c
@@ -3179,16 +3179,17 @@ isboollike(Function *fn, Ref r)
if (ins->op == Ophi) { /* check if all the phi args are boollike */
Block *blk;
Ref *phi = NULL;
- for (blk = fn->curblk; phi == NULL; blk = blk->lprev) {
+ for (blk = fn->curblk;; blk = blk->lprev) {
/* find blk that defines phi */
assert(blk != fn->entry);
for (int i = 0; i < blk->phi.n; ++i){
if (blk->phi.p[i] == r.i) {
phi = phitab.p[ins->l.i];
- break;
+ goto Found;
}
}
}
+ Found:
for (int i = 0; i < blk->npred; ++i) {
if (!isboollike(fn, phi[i])) {
return 0;