aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/expand.c b/expand.c
index 623b1800..c4f806de 100644
--- a/expand.c
+++ b/expand.c
@@ -1177,8 +1177,12 @@ static void expand_const_expression(struct expression *expr, const char *where)
{
if (expr) {
expand_expression(expr);
- if (expr->type != EXPR_VALUE)
+ if (expr->type != EXPR_VALUE) {
expression_error(expr, "Expected constant expression in %s", where);
+ expr->ctype = &int_ctype;
+ expr->type = EXPR_VALUE;
+ expr->value = 0;
+ }
}
}