]> Cypherpunks repositories - gostls13.git/commitdiff
bug in argument passing
authorKen Thompson <ken@golang.org>
Sat, 27 Sep 2008 20:32:38 +0000 (13:32 -0700)
committerKen Thompson <ken@golang.org>
Sat, 27 Sep 2008 20:32:38 +0000 (13:32 -0700)
R=r
OCL=16044
CL=16044

src/cmd/gc/dcl.c

index a6cfd3550ab3497edb9c702c0cf27945209a1b72..988cd25bdf4104b4b4787a2c1d3380e95a27cc9b 100644 (file)
@@ -806,13 +806,15 @@ addtyp(Type *n, Type *t, int ctxt)
        t->sym = s;
        t->vargen = vargen;
 
-       dowidth(t);
-       for(f=s->forwtype; f!=T; f=f->nforw) {
-               if(!isptr[f->etype])
-                       fatal("addtyp: forward");
-               f->type = t;
+       if(s->forwtype != T) {
+               dowidth(t);
+               for(f=s->forwtype; f!=T; f=f->nforw) {
+                       if(!isptr[f->etype])
+                               fatal("addtyp: forward");
+                       f->type = t;
+               }
+               s->forwtype = T;
        }
-       s->forwtype = T;
 
        d = dcl();
        d->dsym = s;