]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: adjust address calculation in identifying abort on windows/arm
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 27 Nov 2020 21:07:23 +0000 (22:07 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 27 Nov 2020 22:28:11 +0000 (22:28 +0000)
Apparently we're being called on arm 1 byte off, just like on 386 and
amd64, so unify the handler for isAbortPC.

Fixes #42859.
Updates #29050.

Change-Id: I97fffeb4a33d93ca3397ce1c9ba2b05137f391ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/273727
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>

src/runtime/signal_windows.go

index 6d98d0259898f1f77c1edcd5f1f79a91236a8131..3af2e39b088d43bcdc6ee858e40d08bad06b5bd5 100644 (file)
@@ -43,16 +43,9 @@ func initExceptionHandler() {
 //
 //go:nosplit
 func isAbort(r *context) bool {
-       switch GOARCH {
-       case "386", "amd64":
-               // In the case of an abort, the exception IP is one byte after
-               // the INT3 (this differs from UNIX OSes).
-               return isAbortPC(r.ip() - 1)
-       case "arm":
-               return isAbortPC(r.ip())
-       default:
-               return false
-       }
+       // In the case of an abort, the exception IP is one byte after
+       // the INT3 (this differs from UNIX OSes).
+       return isAbortPC(r.ip() - 1)
 }
 
 // isgoexception reports whether this exception should be translated