harec

[hare] Hare compiler, written in C11 for POSIX OSs
Log | Files | Refs | README | LICENSE

commit 8f49665e1fec8bd5cd8932d960e3ff7ba74cbea7
parent c9f4fc95854593dca67fce70415950922d9413df
Author: Ember Sawady <ecs@d2evs.net>
Date:   Sat, 11 Feb 2023 21:08:44 +0000

gen: extend if conditions

Signed-off-by: Ember Sawady <ecs@d2evs.net>

Diffstat:
Msrc/gen.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -2247,6 +2247,7 @@ gen_expr_if_with(struct gen_context *ctx, struct qbe_value bend = mklabel(ctx, &lend, ".%d"); struct gen_value cond = gen_expr(ctx, expr->_if.cond); struct qbe_value qcond = mkqval(ctx, &cond); + qcond = extend(ctx, qcond, &builtin_type_bool); pushi(ctx->current, NULL, Q_JNZ, &qcond, &btrue, &bfalse, NULL); push(&ctx->current->body, &ltrue);