summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-05-02 11:47:19 -0400
committerOri Bernstein <ori@eigenstate.org>2013-05-02 11:47:19 -0400
commit2f21c3c5259217207c919396844d177e927e2d25 (patch)
tree05f281e04146a46c8b29f8ad90110397f9db8f91
parent6ef4f09df64f4215213545cc9d1da748c830362b (diff)
downloadmc-2f21c3c5259217207c919396844d177e927e2d25.tar.gz
Write types after stabs.
We're modifying things so that all types are collected into identifiers before writing for serialization purposes.
-rw-r--r--parse/use.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse/use.c b/parse/use.c
index 857f9de..b9aa0d0 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -372,8 +372,8 @@ static void pickle(Node *n, FILE *fd)
pickle(n->decl.init, fd);
break;
case Nfunc:
- wrtype(fd, n->func.type);
wrstab(fd, n->func.scope);
+ wrtype(fd, n->func.type);
wrint(fd, n->func.nargs);
for (i = 0; i < n->func.nargs; i++)
pickle(n->func.args[i], fd);
@@ -497,8 +497,8 @@ static Node *unpickle(FILE *fd)
lappend(&decls, &ndecls, n);
break;
case Nfunc:
- n->func.type = rdtype(fd);
n->func.scope = rdstab(fd);
+ n->func.type = rdtype(fd);
n->func.nargs = rdint(fd);
n->func.args = xalloc(sizeof(Node *)*n->func.nargs);
n->func.scope->super = curstab();