diff --git a/src/cmd/gc/go.h b/src/cmd/gc/go.h index dc6de63c6c6..775a4cca12d 100644 --- a/src/cmd/gc/go.h +++ b/src/cmd/gc/go.h @@ -156,6 +156,7 @@ struct Type uchar embedded; // TFIELD embedded type uchar siggen; uchar funarg; + uchar copyany; // TFUNCT uchar thistuple; diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index cd2fc4d2d53..5638df4b7dd 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -1779,6 +1779,8 @@ loop: goto loop; case TANY: + if(!st->copyany) + return 0; *stp = t; break; @@ -1841,6 +1843,11 @@ deep(Type *t) nt = t; // share from here down break; + case TANY: + nt = shallow(t); + nt->copyany = 1; + break; + case TPTR32: case TPTR64: case TCHAN: