summaryrefslogtreecommitdiff
path: root/parse/dump.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-05-08 14:06:23 -0400
committerOri Bernstein <ori@eigenstate.org>2014-05-08 14:06:23 -0400
commitdf187615868a82da67b31b921334449f7db5a868 (patch)
treecca8096f0ddc8f9500bb7e9ba862766e60ea5914 /parse/dump.c
parent226ef2e101258817ee3c41a28846c607d880a69c (diff)
downloadmc-df187615868a82da67b31b921334449f7db5a868.tar.gz
Default the types correctly in specialized functions.
If we have @a::(numerical,integral), for example, in a function that is not unfied with any specific numerical,integral type, we need to default it to an int. This does that.
Diffstat (limited to 'parse/dump.c')
-rw-r--r--parse/dump.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse/dump.c b/parse/dump.c
index 5a867fb..e921b1c 100644
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -114,6 +114,7 @@ static void outnode(Node *n, FILE *fd, int depth)
{
size_t i;
char *ty;
+ char *tr;
int tid;
char buf[1024];
@@ -138,8 +139,11 @@ static void outnode(Node *n, FILE *fd, int depth)
outnode(n->file.stmts[i], fd, depth + 1);
break;
case Ndecl:
+ tr = "";
+ if (n->decl.trait)
+ tr = namestr(n->decl.trait->name);
fprintf(fd, "(did = %zd, trait=%s, isconst = %d, isgeneric = %d, isextern = %d, vis = %d)\n",
- n->decl.did, namestr(n->decl.trait->name), n->decl.isconst, n->decl.isgeneric, n->decl.isextern, n->decl.vis);
+ n->decl.did, tr, n->decl.isconst, n->decl.isgeneric, n->decl.isextern, n->decl.vis);
outsym(n, fd, depth + 1);
outnode(n->decl.init, fd, depth + 1);
break;