From 749cef5673d23142f70c77cb2c6eb8de411343e1 Mon Sep 17 00:00:00 2001 From: Kai Backman Date: Tue, 29 Sep 2009 07:27:49 -0700 Subject: fixed alignment issue resulting from confusion around the meaning of out args. go/test: passes 68% (231/339) R=rsc APPROVED=rsc DELTA=13 (7 added, 0 deleted, 6 changed) OCL=35072 CL=35080 --- src/cmd/5g/gsubr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/cmd/5g/gsubr.c') diff --git a/src/cmd/5g/gsubr.c b/src/cmd/5g/gsubr.c index 4ad764797..8d2291270 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 + 4; + n->xoffset = first->width; n->addable = 1; goto fp; } @@ -364,7 +364,7 @@ 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 + 4; + n->xoffset = t->width; n->addable = 1; fp: @@ -372,12 +372,13 @@ fp: default: fatal("nodarg %T %d", t, fp); - case 0: // output arg + case 0: // output arg for calling another function n->op = OINDREG; n->val.u.reg = REGSP; + n->xoffset += 4; break; - case 1: // input arg + case 1: // input arg to current function n->class = PPARAM; break; } -- cgit v1.2.3