diff options
author | Michael Forney <mforney@mforney.org> | 2021-10-02 18:07:16 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-10-02 18:07:16 -0700 |
commit | 0dd2b051236ff1d286c0e4368862ce4f3fd3880c (patch) | |
tree | fa64bf4091e223a7ffc4bf3c77d55be3f4fc8138 /qbe.c | |
parent | e36dc296f50cb2d60d3b27ce62217762b9655313 (diff) |
qbe: Re-add conversion to bool RHS of logical and/or
7e838669 removed conversion to bool for int expressions used only
to control jnz, but incorrectly dropped the conversion for the
right-hand-side of logical and/or as well. We need the result of
the expression to be 0 or 1, so we still need that conversion.
Diffstat (limited to 'qbe.c')
-rw-r--r-- | qbe.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -807,7 +807,7 @@ funcexpr(struct func *f, struct expr *e) b[1]->phi.blk[0] = f->end; funclabel(f, b[0]); r = funcexpr(f, e->binary.r); - b[1]->phi.val[1] = r; + b[1]->phi.val[1] = convert(f, &typebool, e->binary.r->type, r); b[1]->phi.blk[1] = f->end; funclabel(f, b[1]); functemp(f, &b[1]->phi.res); |