aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_openbsd_arm.s
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2017-10-14 08:46:50 -0700
committerIan Lance Taylor <iant@golang.org>2017-10-16 17:15:39 +0000
commit5ddd3d588c589ae644cadd2d8e5341669dae888e (patch)
treeeab9782878dbde71023a87ecc238753e3f9f4740 /src/runtime/sys_openbsd_arm.s
parent001fe1d57a357225316d67f1516fde9e2c378bb0 (diff)
downloadgo-5ddd3d588c589ae644cadd2d8e5341669dae888e.tar.gz
go-5ddd3d588c589ae644cadd2d8e5341669dae888e.zip
runtime: fix use of STREX in various exitThread implementations
STREX does not permit using the same register for the value to store and the place where the result is returned. Also the code was wrong anyhow if the first store failed. Fixes #22248 Change-Id: I96013497410058514ffcb771c76c86faa1ec559b Reviewed-on: https://go-review.googlesource.com/70911 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/sys_openbsd_arm.s')
-rw-r--r--src/runtime/sys_openbsd_arm.s4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/sys_openbsd_arm.s b/src/runtime/sys_openbsd_arm.s
index c6e9e4ec17..0b77d121f4 100644
--- a/src/runtime/sys_openbsd_arm.s
+++ b/src/runtime/sys_openbsd_arm.s
@@ -26,10 +26,10 @@ TEXT runtime·exit(SB),NOSPLIT,$-4
TEXT runtime·exitThread(SB),NOSPLIT,$0-4
MOVW wait+0(FP), R0
// We're done using the stack.
- MOVW $0, R1
+ MOVW $0, R2
storeloop:
LDREX (R0), R4 // loads R4
- STREX R1, (R0), R1 // stores R2
+ STREX R2, (R0), R1 // stores R2
CMP $0, R1
BNE storeloop
MOVW $0, R0 // arg 1 - notdead