]> Cypherpunks repositories - gostls13.git/commitdiff
do not use fake names on anonymous function return values
authorRuss Cox <rsc@golang.org>
Thu, 23 Oct 2008 00:45:47 +0000 (17:45 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 23 Oct 2008 00:45:47 +0000 (17:45 -0700)
R=ken
OCL=17679
CL=17679

src/cmd/6g/gsubr.c
src/cmd/gc/dcl.c
src/cmd/gc/subr.c

index b5cb9fd2294a9d75ea310d7a1bba643938fdf0e0..b158f09b9c7c63eb5c3bb38958cb86c029d11b55 100644 (file)
@@ -1002,10 +1002,8 @@ naddr(Node *n, Addr *a)
                a->etype = n->etype;
                a->offset = n->xoffset;
                a->sym = n->sym;
-               if(a->sym == S) {
+               if(a->sym == S)
                        a->sym = lookup(".noname");
-                       fatal("noname");
-               }
                if(n->method) {
                        if(n->type != T)
                        if(n->type->sym != S)
index 9a4fe730367cb6fdfb8b5ed71e3a01a87b54662a..f836f3ba749606ee7f3aee1100f38b80f8745719 100644 (file)
@@ -472,12 +472,8 @@ loop:
        if(n->left != N && n->left->op == ONAME) {
                f->nname = n->left;
                f->embedded = n->embedded;
-       } else {
-               vargen++;
-               snprint(buf, sizeof(buf), "_e%s_%.3ld", filename, vargen);
-               f->nname = newname(lookup(buf));
+               f->sym = f->nname->sym;
        }
-       f->sym = f->nname->sym;
 
        *t = f;
        t = &f->down;
index b66bd2bc8a2f0501fa7230fef58c259bcbb52e5c..d81c47c9f4cc2a7c884f9a7cb8ef7050d5d3942a 100644 (file)
@@ -1061,7 +1061,7 @@ Tpretty(Fmt *fp, Type *t)
                return fmtprint(fp, " }");
 
        case TFIELD:
-               if(t->sym == S || t->sym->name[0] == '_' || t->embedded) {
+               if(t->sym == S || t->embedded) {
                        if(exporting)
                                fmtprint(fp, "? ");
                        return fmtprint(fp, "%T", t->type);