summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-04-05 20:41:24 -0400
committerOri Bernstein <ori@eigenstate.org>2013-04-05 20:41:24 -0400
commit9c1dd3355d31004cc2875f1ed055372e9b8b6d50 (patch)
tree09255d49336eea524d3ede2ac92f19fc429e0872
parenta2c579cf237bd9b76acda6862a5c52976bbbc66c (diff)
downloadmc-9c1dd3355d31004cc2875f1ed055372e9b8b6d50.tar.gz
Don't double-name types in usefiles.
-rw-r--r--parse/use.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/parse/use.c b/parse/use.c
index cd41da1..e17ae0d 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -40,7 +40,6 @@ int loaduse(FILE *f, Stab *st)
Stab *s;
Node *dcl;
Type *t;
- Node *n;
int c;
if (fgetc(f) != 'U')
@@ -70,9 +69,9 @@ int loaduse(FILE *f, Stab *st)
putdcl(s, dcl);
break;
case 'T':
- n = mkname(-1, rdstr(f));
t = tyunpickle(f);
- puttype(s, n, t);
+ assert(t->type == Tyname || t->type == Tygeneric);
+ puttype(s, t->name, t);
break;
case EOF:
break;
@@ -113,7 +112,7 @@ void readuse(Node *use, Stab *st)
/* Usefile format:
* U<pkgname>
- * T<typename><pickled-type>
+ * T<pickled-type>
* D<picled-decl>
* G<pickled-decl><pickled-initializer>
* Z
@@ -136,8 +135,8 @@ void writeuse(FILE *f, Node *file)
k = htkeys(st->ty, &n);
for (i = 0; i < n; i++) {
t = gettype(st, k[i]);
+ assert(t->type == Tyname || t->type == Tygeneric);
wrbyte(f, 'T');
- wrstr(f, namestr(k[i]));
typickle(t, f);
}
free(k);