From: Kai Backman Date: Mon, 13 Jul 2009 05:12:33 +0000 (-0700) Subject: fixed typo where output arguments where pushed on to R0 X-Git-Tag: weekly.2009-11-06~1177 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=092d6290d0fcdf79a4d6f87ab43888542fc984fa;p=gostls13.git fixed typo where output arguments where pushed on to R0 instead of SP. R=rsc APPROVED=rsc DELTA=13 (3 added, 7 deleted, 3 changed) OCL=31488 CL=31501 --- diff --git a/src/cmd/5g/gsubr.c b/src/cmd/5g/gsubr.c index aea27f18d0..999592bf20 100644 --- a/src/cmd/5g/gsubr.c +++ b/src/cmd/5g/gsubr.c @@ -351,7 +351,7 @@ nodarg(Type *t, int fp) fatal("nodarg: bad struct"); if(first->width == BADWIDTH) fatal("nodarg: offset not computed for %T", t); - n->xoffset = first->width; + n->xoffset = first->width + 4; n->addable = 1; goto fp; } @@ -364,26 +364,22 @@ nodarg(Type *t, int fp) n->sym = t->sym; if(t->width == BADWIDTH) fatal("nodarg: offset not computed for %T", t); - n->xoffset = t->width; + n->xoffset = t->width + 4; n->addable = 1; fp: switch(fp) { + default: + fatal("nodarg %T %d", t, fp); + case 0: // output arg n->op = OINDREG; - n->val.u.reg = REGRET; + n->val.u.reg = REGSP; break; case 1: // input arg n->class = PPARAM; break; - - case 2: // offset output arg -fatal("shouldnt be used"); - n->op = OINDREG; - n->val.u.reg = REGSP; - n->xoffset += types[tptr]->width; - break; } return n; }