shithub: mc

Download patch

ref: 666970ff83272349c1713169bf7cb49964366fb1
parent: e1b637d15c896bebe20afc8cc0563907cd028649
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Oct 18 19:27:45 EDT 2018

Not all arrays have defined sizes.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2221,7 +2221,7 @@
 		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;