mirror of
https://github.com/golang/go
synced 2024-11-12 09:50:21 -07:00
do not use fake names on anonymous function return values
R=ken OCL=17679 CL=17679
This commit is contained in:
parent
6fecb76eea
commit
ad48706a24
@ -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:
|
|||||||
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)
|
|||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user