From 7be2b9fdf67cb81f5d1930147f24e3071b7a9a0b Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Sat, 27 Sep 2008 13:32:38 -0700 Subject: [PATCH] bug in argument passing R=r OCL=16044 CL=16044 --- src/cmd/gc/dcl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cmd/gc/dcl.c b/src/cmd/gc/dcl.c index a6cfd3550ab..988cd25bdf4 100644 --- a/src/cmd/gc/dcl.c +++ b/src/cmd/gc/dcl.c @@ -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;