summaryrefslogtreecommitdiff
path: root/src/cmd/5g/gsubr.c
diff options
context:
space:
mode:
authorKai Backman <kaib@golang.org>2009-09-29 07:27:49 -0700
committerKai Backman <kaib@golang.org>2009-09-29 07:27:49 -0700
commit749cef5673d23142f70c77cb2c6eb8de411343e1 (patch)
treebe823ea33e69b3a9a95f5f8d347c2d1df6676839 /src/cmd/5g/gsubr.c
parent1661c888603d6510e42137f87f5a64a407a47098 (diff)
downloadgolang-749cef5673d23142f70c77cb2c6eb8de411343e1.tar.gz
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
Diffstat (limited to 'src/cmd/5g/gsubr.c')
-rw-r--r--src/cmd/5g/gsubr.c9
1 files changed, 5 insertions, 4 deletions
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;
}