diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-11 18:20:51 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-11 18:20:51 +0200 |
commit | 65ba62230b88bcc2d570418b88f2dc0152822a36 (patch) | |
tree | 33350243392dc422ebd16e2d4d4ab74048028050 | |
parent | 9554805cc1baecf0f4f47b3537078f68b37dd4e0 (diff) | |
parent | 6ed98066f6d184f2f0f918570aaa6a1934668ac2 (diff) | |
download | sparse-65ba62230b88bcc2d570418b88f2dc0152822a36.tar.gz |
Merge branch 'force-to-0' into master
* force to 0 expressions which are erroneously non-constant
-rw-r--r-- | expand.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; + } } } |