commit ece814f70d1a26d827652bddca5723307745a6e9
parent 1e505030f673e987de582c7377d1f476419c887e
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 13 Feb 2021 12:34:19 -0500
check: fix result type of control exprs
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/check.c b/src/check.c
@@ -1142,6 +1142,7 @@ check_expr_control(struct context *ctx,
{
trenter(TR_CHECK, "control");
expr->type = aexpr->type;
+ expr->result = &builtin_type_void;
expr->terminates = true;
char *label = expr->control.label = aexpr->control.label;
@@ -2001,6 +2002,7 @@ check_expression(struct context *ctx,
}
trleave(TR_CHECK, NULL);
+ assert(expr->result);
}
static struct declaration *