diff options
| author | 2026-03-19 21:42:42 +0100 | |
|---|---|---|
| committer | 2026-03-19 22:09:08 +0100 | |
| commit | fdbe13a0e9fe866310ec198fec43172ccad89106 (patch) | |
| tree | cf5d02b6f4336c4d92178dbba0512f6057dc2141 | |
| parent | 243e4e6b1540dce0024ae2b6952acb969369b5be (diff) | |
c: fix isboollike() for phis
| -rw-r--r-- | src/c.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |