summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-05-30 08:52:32 -0400
committerOri Bernstein <ori@eigenstate.org>2013-05-30 09:49:47 -0400
commit9f712a5afd6824b2dfff10b7998cf5f3608cc738 (patch)
tree8fb52c5c32bec97250a1251c051bb7c046f3f100
parent468ae14b7a8a2b114570b269c58ab23c31883299 (diff)
downloadmc-closures.tar.gz
unbreak union constructors.closures
We weren't reading the types and adding them to the namespace.
-rw-r--r--parse/use.c18
1 files 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;