summaryrefslogtreecommitdiff
path: root/parse/dump.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-06-18 14:27:45 -0400
committerOri Bernstein <ori@eigenstate.org>2013-06-18 14:27:45 -0400
commita9407d8bbc6edce694be614f4bfed8bd037c6862 (patch)
tree5470e0e521af57af8bbf1228bf57f430408cfa09 /parse/dump.c
parentcc8d65b2d48716971a2bd060c7e55351137f638f (diff)
downloadmc-a9407d8bbc6edce694be614f4bfed8bd037c6862.tar.gz
Fix a bug in array size inference.
It's not a literal any more. Don't use fields from literals.
Diffstat (limited to 'parse/dump.c')
-rw-r--r--parse/dump.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse/dump.c b/parse/dump.c
index 6dff854..6485e59 100644
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -112,6 +112,7 @@ static void outnode(Node *n, FILE *fd, int depth)
{
size_t i;
char *ty;
+ int tid;
indent(fd, depth);
if (!n) {
@@ -174,8 +175,12 @@ static void outnode(Node *n, FILE *fd, int depth)
break;
case Nexpr:
ty = tystr(n->expr.type);
+ if (n->expr.type)
+ tid = n->expr.type->tid;
+ else
+ tid = -1;
fprintf(fd, " (type = %s [tid %d], op = %s, isconst = %d, did=%zd)\n",
- ty, n->expr.type->tid, opstr(n->expr.op), n->expr.isconst, n->expr.did);
+ ty, tid, opstr(n->expr.op), n->expr.isconst, n->expr.did);
free(ty);
outnode(n->expr.idx, fd, depth + 1);
for (i = 0; i < n->expr.nargs; i++)