summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-08 22:03:57 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-08 22:03:57 -0700
commitbd5fb6d0628831cde25f13e3fe461786d616a06e (patch)
treebddbfa56fa2c43fc233e9a614e2bd977ad335ff6 /parse
parent8c8335a2471a99d29e26ca60788ec7dc6dd5e768 (diff)
downloadmc-bd5fb6d0628831cde25f13e3fe461786d616a06e.tar.gz
Print unlenghted array types correctly.
Diffstat (limited to 'parse')
-rw-r--r--parse/type.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse/type.c b/parse/type.c
index 6a29d1d..0e5b059 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -557,7 +557,12 @@ static int tybfmt(char *buf, size_t len, Type *t)
break;
case Tyarray:
p += tybfmt(p, end - p, t->sub[0]);
- p += snprintf(p, end - p, "[%llu]", t->asize->expr.args[0]->lit.intval);
+ if (t->asize) {
+ i = t->asize->expr.args[0]->lit.intval;
+ p += snprintf(p, end - p, "[%zd]", i);
+ } else {
+ p += snprintf(p, end - p, "[]");
+ }
break;
case Tyfunc:
p += snprintf(p, end - p, "(");