summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-31 09:43:08 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-31 09:43:08 -0700
commit118c93adea60980900d8976944f2eb05496783d2 (patch)
tree543032b6ef1cc6e899d51ce8ed1cae0fb69550b0 /parse
parentd22285a6aba8f6a5eba9da13fb712561e101100b (diff)
downloadmc-118c93adea60980900d8976944f2eb05496783d2.tar.gz
Handle empty array sizes correctly.
The size parameter *may* be null.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index d1465ee..67db28f 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2032,7 +2032,7 @@ tyfix(Node *ctx, Type *orig, int noerr)
if (t->type == Tyarray) {
typesub(t->asize, noerr);
t->asize = fold(t->asize, 1);
- if (exprop(t->asize) != Olit)
+ if (t->asize && exprop(t->asize) != Olit)
fatal(t->asize, "nonconstant array size near %s\n", ctxstr(t->asize));
} else if (t->type == Tystruct) {
inaggr++;