From 9f712a5afd6824b2dfff10b7998cf5f3608cc738 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Thu, 30 May 2013 08:52:32 -0400 Subject: unbreak union constructors. We weren't reading the types and adding them to the namespace. --- parse/use.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/parse/use.c b/parse/use.c index 5af8cc7..cc985a7 100644 --- a/parse/use.c +++ b/parse/use.c @@ -117,9 +117,9 @@ static Ucon *rducon(FILE *fd, Type *ut) line = rdint(fd); id = rdint(fd); name = unpickle(fd); - if (rdbool(fd)) - rdtype(fd, &et); uc = mkucon(line, name, ut, et); + if (rdbool(fd)) + rdtype(fd, &uc->etype); uc->id = id; return uc; } @@ -593,11 +593,12 @@ static void fixmappings(Stab *st) */ int loaduse(FILE *f, Stab *st) { + intptr_t tid; + size_t i; char *pkg; - Stab *s; Node *dcl; + Stab *s; Type *t; - intptr_t tid; int c; if (fgetc(f) != 'U') @@ -635,13 +636,10 @@ int loaduse(FILE *f, Stab *st) if (t->type == Tyname || t->type == Tygeneric) if (!gettype(s, t->name)) puttype(s, t->name, t); - /* - u = tybase(t); - if (u->type == Tyunion) { - for (i = 0; i < u->nmemb; i++) - putucon(s, u->udecls[i]); + if (t->type == Tyunion) { + for (i = 0; i < t->nmemb; i++) + putucon(s, t->udecls[i]); } - */ break; case EOF: break; -- cgit v1.1