Commit ad48706a authored by Russ Cox's avatar Russ Cox

do not use fake names on anonymous function return values

R=ken
OCL=17679
CL=17679
parent 6fecb76e
...@@ -1002,10 +1002,8 @@ naddr(Node *n, Addr *a) ...@@ -1002,10 +1002,8 @@ naddr(Node *n, Addr *a)
a->etype = n->etype; a->etype = n->etype;
a->offset = n->xoffset; a->offset = n->xoffset;
a->sym = n->sym; a->sym = n->sym;
if(a->sym == S) { if(a->sym == S)
a->sym = lookup(".noname"); a->sym = lookup(".noname");
fatal("noname");
}
if(n->method) { if(n->method) {
if(n->type != T) if(n->type != T)
if(n->type->sym != S) if(n->type->sym != S)
......
...@@ -472,12 +472,8 @@ loop: ...@@ -472,12 +472,8 @@ loop:
if(n->left != N && n->left->op == ONAME) { if(n->left != N && n->left->op == ONAME) {
f->nname = n->left; f->nname = n->left;
f->embedded = n->embedded; f->embedded = n->embedded;
} else { f->sym = f->nname->sym;
vargen++;
snprint(buf, sizeof(buf), "_e%s_%.3ld", filename, vargen);
f->nname = newname(lookup(buf));
} }
f->sym = f->nname->sym;
*t = f; *t = f;
t = &f->down; t = &f->down;
......
...@@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t) ...@@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t)
return fmtprint(fp, " }"); return fmtprint(fp, " }");
case TFIELD: case TFIELD:
if(t->sym == S || t->sym->name[0] == '_' || t->embedded) { if(t->sym == S || t->embedded) {
if(exporting) if(exporting)
fmtprint(fp, "? "); fmtprint(fp, "? ");
return fmtprint(fp, "%T", t->type); return fmtprint(fp, "%T", t->type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment