summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-01-14 14:05:20 -0500
committerRuss Cox <rsc@golang.org>2011-01-14 14:05:20 -0500
commit6ff994f3dd69c7e7939ca2ba886067a41e9a6de3 (patch)
tree1fd024685d96e76a4bbb8f63f79a23faa88900f3 /src/cmd
parente4847b98d17d6c1c4f5adc49afd7e9249d7f6c2e (diff)
downloadgo-6ff994f3dd69c7e7939ca2ba886067a41e9a6de3.tar.gz
runtime: fix arm reflect.call boundary case
The fault was lucky: when it wasn't faulting it was silently copying a word from some other block and later putting that same word back. If some other goroutine had changed that word of memory in the interim, too bad. The ARM code was inconsistent about whether the "argument frame" included the saved LR. Including it made some things more regular but mostly just caused confusion in the places where the regularity broke. Now the rule reflects reality: argp is always a pointer to arguments, never a saved link register. Renamed struct fields to make meaning clearer. Running ARM in QEMU, package time's gotest: * before: 27/58 failed * after: 0/50 R=r, r2 CC=golang-dev http://codereview.appspot.com/3993041
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/5g/ggen.c2
-rw-r--r--src/cmd/5l/noop.c9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/cmd/5g/ggen.c b/src/cmd/5g/ggen.c
index 932b4877c..182d7f147 100644
--- a/src/cmd/5g/ggen.c
+++ b/src/cmd/5g/ggen.c
@@ -172,7 +172,7 @@ ginscall(Node *f, int proc)
p->to.reg = REGSP;
p->to.offset = 8;
- nodconst(&con, types[TINT32], argsize(f->type) + 4);
+ nodconst(&con, types[TINT32], argsize(f->type));
gins(AMOVW, &con, &r);
p = gins(AMOVW, &r, N);
p->to.type = D_OREG;
diff --git a/src/cmd/5l/noop.c b/src/cmd/5l/noop.c
index 5def0d3f1..925984d75 100644
--- a/src/cmd/5l/noop.c
+++ b/src/cmd/5l/noop.c
@@ -340,13 +340,12 @@ noops(void)
p->to.type = D_REG;
p->to.reg = 1;
- // MOVW.LO $args +4, R2
- // also need to store the extra 4 bytes.
+ // MOVW.LO $args, R2
p = appendp(p);
p->as = AMOVW;
p->scond = C_SCOND_LO;
p->from.type = D_CONST;
- p->from.offset = ((cursym->text->to.offset2 + 3) & ~3) + 4;
+ p->from.offset = (cursym->text->to.offset2 + 3) & ~3;
p->to.type = D_REG;
p->to.reg = 2;
@@ -391,12 +390,12 @@ noops(void)
p->to.type = D_REG;
p->to.reg = 1;
- // MOVW $args +4, R2
+ // MOVW $args, R2
// also need to store the extra 4 bytes.
p = appendp(p);
p->as = AMOVW;
p->from.type = D_CONST;
- p->from.offset = ((cursym->text->to.offset2 + 3) & ~3) + 4;
+ p->from.offset = (cursym->text->to.offset2 + 3) & ~3;
p->to.type = D_REG;
p->to.reg = 2;