diff options
author | Michael Forney <mforney@mforney.org> | 2019-07-05 12:51:34 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-07-05 12:51:34 -0700 |
commit | b50da146cd150937f9c2b7d7813a307de411e298 (patch) | |
tree | 9d3ee6172d4dd861b79e116072dcf3841f8830b8 /stmt.c | |
parent | 3cc28c8428306a66350ef3722d45ed8c49bc6f15 (diff) |
stmt: Fix conversion of controlling expression to bool
In d875bf74, I accidentally converted the increment expression to bool
rather than the controlling expression.
Whoops, I should check the updated test case IL more carefully next time.
Diffstat (limited to 'stmt.c')
-rw-r--r-- | stmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -220,13 +220,13 @@ stmt(struct func *f, struct scope *s) funclabel(f, label[0]); if (tok.kind != TSEMICOLON) { - e = expr(s); + e = exprconvert(expr(s), &typebool); v = funcexpr(f, e); funcjnz(f, v, label[1], label[3]); delexpr(e); } expect(TSEMICOLON, NULL); - e = tok.kind == TRPAREN ? NULL : exprconvert(expr(s), &typebool); + e = tok.kind == TRPAREN ? NULL : expr(s); expect(TRPAREN, NULL); funclabel(f, label[1]); |