cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 3bdc9dc8a2e53cb745e0555dc30f0e2b2df4d444
parent 9a393428186c42b7dc227e3f7a1bc3cbb0c099aa
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 19 Nov 2019 19:49:50 -0800

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.

Diffstat:
Mdecl.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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;