aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-11-19 19:49:50 -0800
committerMichael Forney <mforney@mforney.org>2019-11-19 19:49:50 -0800
commit3bdc9dc8a2e53cb745e0555dc30f0e2b2df4d444 (patch)
tree97ad92f0a20701523261aa6d77197ac24bf7ffbe
parent9a393428186c42b7dc227e3f7a1bc3cbb0c099aa (diff)
decl: Parse array size as an assignment-expression
Even though we don't support VLAs yet, we should still be parsing the VLA syntax, then failing after if it was not a constant expression.
-rw-r--r--decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/decl.c b/decl.c
index 8eae666..9013a09 100644
--- a/decl.c
+++ b/decl.c
@@ -565,7 +565,7 @@ declaratortypes(struct scope *s, struct list *result, char **name, bool allowabs
i = 0;
next();
} else {
- e = constexpr(s);
+ e = eval(assignexpr(s), EVALARITH);
if (e->kind != EXPRCONST || !(e->type->prop & PROPINT))
error(&tok.loc, "VLAs are not yet supported");
i = e->constant.i;