From 160d2c2b424adfbd456f61cb5e194888a054ff51 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Fri, 8 May 2015 22:03:57 -0700 Subject: Print unlenghted array types correctly. --- parse/type.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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, "("); -- cgit v1.1