shithub: mc

Download patch

ref: 2f21c3c5259217207c919396844d177e927e2d25
parent: 6ef4f09df64f4215213545cc9d1da748c830362b
author: Ori Bernstein <[email protected]>
date: Thu May 2 07:47:19 EDT 2013

Write types after stabs.

    We're modifying things so that all types are collected into
    identifiers before writing for serialization purposes.

--- a/parse/use.c
+++ b/parse/use.c
@@ -372,8 +372,8 @@
             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 @@
             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();