diff options
author | Shenghou Ma <minux@golang.org> | 2015-09-03 02:44:26 -0400 |
---|---|---|
committer | Minux Ma <minux@golang.org> | 2015-11-25 00:46:57 +0000 |
commit | 3583a44ed2ae27495626caaa431b197187dcf01b (patch) | |
tree | 571f3308f21b6be4d1107e9974af1f76caa273bc /src/runtime/asm_arm64.s | |
parent | 3cac3b5fca48dbd5715bb05936252eba1bb51c26 (diff) | |
download | go-3583a44ed2ae27495626caaa431b197187dcf01b.tar.gz go-3583a44ed2ae27495626caaa431b197187dcf01b.zip |
runtime: check that masks and shifts are correct aligned
We need a runtime check because the original issue is encountered
when running cross compiled windows program from linux. It's better
to give a meaningful crash message earlier than to segfault later.
The added test should not impose any measurable overhead to Go
programs.
For #12415.
Change-Id: Ib4a24ef560c09c0585b351d62eefd157b6b7f04c
Reviewed-on: https://go-review.googlesource.com/14207
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/asm_arm64.s')
-rw-r--r-- | src/runtime/asm_arm64.s | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index 33755b35c0..8931daa2cd 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -996,4 +996,8 @@ TEXT runtime·addmoduledata(SB),NOSPLIT,$0-0 MOVD R0, runtime·lastmoduledatap(SB) MOVD 8(RSP), R27 ADD $0x10, RSP + +TEXT ·checkASM(SB),NOSPLIT,$0-1 + MOVW $1, R3 + MOVB R3, ret+0(FP) RET |