diff options
| author | 2025-09-14 19:23:21 +0200 | |
|---|---|---|
| committer | 2025-09-14 19:23:21 +0200 | |
| commit | 6cb4382b0128942f4ba57ab26021be1e5715f2bc (patch) | |
| tree | 0b63731286acbe503981958930aeae93816b6b34 /c.c | |
| parent | 7a318363ec4fdcd80d9d0154cef393c9bf205d5e (diff) | |
codegen: float cmp, ior; frontend: fix cond expr bug
Diffstat (limited to 'c.c')
| -rw-r--r-- | c.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -2531,7 +2531,6 @@ condexprrec(struct function *fn, const struct expr *ex, struct condphis *phis, int boolcon, struct block *const next, struct block *end) { struct block *tr, *fl; - union ref r; while (ex->t == ESEQ) { expreffects(fn, &ex->sub[0]); ex = &ex->sub[1]; @@ -2555,16 +2554,16 @@ condexprrec(struct function *fn, const struct expr *ex, struct condphis *phis, useblk(fn, fl); condexprrec(fn, &ex->sub[2], phis, -1, end, end); } else { - r = exprvalue(fn, ex); + union ref r = exprvalue(fn, ex), val = r; if (boolcon >= 0) { if (!next || next == end) { boolcon = -1; - r = cvt(fn, TYBOOL, ex->ty.t, r); + val = cvt(fn, TYBOOL, ex->ty.t, r); } else { - r = mkref(RICON, boolcon); + val = mkref(RICON, boolcon); } } - vpush(&phis->ref, r); + vpush(&phis->ref, val); if (next && next != end) { putcondbranch(fn, r, next, end); } else { |