summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-03-02 01:01:02 -0500
committerOri Bernstein <ori@eigenstate.org>2016-03-02 01:01:02 -0500
commitc9a52e525ad76c04172a99034a99c809e5639ac5 (patch)
treed23cfa8ad25a755e5608fdab3d289d00fc08f007 /parse/node.c
parent82c1dc9af055897ffeb373aee2a107ac0d472156 (diff)
downloadmc-c9a52e525ad76c04172a99034a99c809e5639ac5.tar.gz
Handle null and named array sizes for tyeq_rec
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse/node.c b/parse/node.c
index d4dee5c..ff725e5 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -30,7 +30,9 @@ uint64_t arraysz(Node *sz)
{
Node *n;
- n = sz;
+ if (!sz)
+ return 0;
+ n = fold(sz, 1);
if (exprop(n) != Olit)
fatal(sz, "too much indirection when finding intializer. (initialization loop?)");