ref: 160d2c2b424adfbd456f61cb5e194888a054ff51
parent: fc6db2b9b5be239dae9d21906e969d6e5207ec34
author: Ori Bernstein <[email protected]>
date: Fri May 8 18:03:57 EDT 2015
Print unlenghted array types correctly.
--- a/parse/type.c
+++ b/parse/type.c
@@ -557,7 +557,12 @@
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, "(");