aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/panic.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-04-05 19:13:34 +0000
committerMichael Knyszek <mknyszek@google.com>2021-04-06 03:31:26 +0000
commit298975c634758ee464dc0629402107bfc33c4b41 (patch)
tree56287ed3cdf8e56e7609ccd89c275ead5a669c81 /src/runtime/panic.go
parentb2389ad3ce7254784db5f4005805714e87ffab85 (diff)
downloadgo-298975c634758ee464dc0629402107bfc33c4b41.tar.gz
go-298975c634758ee464dc0629402107bfc33c4b41.zip
runtime: use funcID to identify abort in isAbortPC
This change eliminates the use of funcPC to determine if an PC is in abort. Using funcPC for this purpose is problematic when using plugins because symbols no longer have unique PCs. funcPC also grabs the wrapper for runtime.abort which isn't what we want for the new register ABI, so rather than mark runtime.abort as ABIInternal, use funcID. For #40724. Change-Id: I2730e99fe6f326d22d64a10384828b94f04d101a Reviewed-on: https://go-review.googlesource.com/c/go/+/307391 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r--src/runtime/panic.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go
index bbf3ea473a..d33441a0d8 100644
--- a/src/runtime/panic.go
+++ b/src/runtime/panic.go
@@ -1484,5 +1484,9 @@ func shouldPushSigpanic(gp *g, pc, lr uintptr) bool {
//
//go:nosplit
func isAbortPC(pc uintptr) bool {
- return pc == funcPC(abort) || ((GOARCH == "arm" || GOARCH == "arm64") && pc == funcPC(abort)+sys.PCQuantum)
+ f := findfunc(pc)
+ if !f.valid() {
+ return false
+ }
+ return f.funcID == funcID_abort
}