summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-10-18 23:27:45 -0700
committerOri Bernstein <ori@eigenstate.org>2018-10-27 15:07:06 -0700
commit666970ff83272349c1713169bf7cb49964366fb1 (patch)
tree00d3b5dcac7113bbc941257f982d4045fa7d29ec
parente1b637d15c896bebe20afc8cc0563907cd028649 (diff)
downloadmc-666970ff83272349c1713169bf7cb49964366fb1.tar.gz
Not all arrays have defined sizes.
-rw-r--r--parse/infer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index cdf1935..1a58db6 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2221,7 +2221,7 @@ tyfix(Node *ctx, Type *orig, int noerr)
case Tyarray:
if (t->type == Tyarray && t->asize)
t->asize = fold(t->asize, 1);
- if (getintlit(t->asize, &val) && val < 0)
+ if (t->asize && getintlit(t->asize, &val) && val < 0)
fatal(t->asize, "negative array size %lld\n", val);
typesub(t->asize, noerr);
break;