diff options
author | Austin Clements <austin@google.com> | 2018-03-09 16:12:40 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2018-03-09 22:17:04 +0000 |
commit | 0def0f2e993111308a114bb83604618f218b7c3d (patch) | |
tree | b7a8044f9062d169e9c7ea1cc0315a0701546899 /src/runtime/panic.go | |
parent | e4de522c95d49d943b99740aa4a1361357dcf869 (diff) | |
download | go-0def0f2e993111308a114bb83604618f218b7c3d.tar.gz go-0def0f2e993111308a114bb83604618f218b7c3d.zip |
runtime: fix abort handling on arm64
The implementation of runtime.abort on arm64 currently branches to
address 0, which results in a signal from PC 0, rather than from
runtime.abort, so the runtime fails to recognize it as an abort.
Fix runtime.abort on arm64 to read from address 0 like what other
architectures do and recognize this in the signal handler.
Should fix the linux/arm64 build.
Change-Id: I960ab630daaeadc9190287604d4d8337b1ea3853
Reviewed-on: https://go-review.googlesource.com/99895
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r-- | src/runtime/panic.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go index d9fa512530..10945ace0d 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -837,3 +837,9 @@ func shouldPushSigpanic(gp *g, pc, lr uintptr) bool { // will work. return true } + +// isAbortPC returns true if pc is the program counter at which +// runtime.abort raises a signal. +func isAbortPC(pc uintptr) bool { + return pc == funcPC(abort) || ((GOARCH == "arm" || GOARCH == "arm64") && pc == funcPC(abort)+sys.PCQuantum) +} |