aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 008bd244e0..8f32320e0c 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -393,6 +393,11 @@ func releaseSudog(s *sudog) {
// funcPC returns the entry PC of the function f.
// It assumes that f is a func value. Otherwise the behavior is undefined.
+// CAREFUL: In programs with plugins, funcPC can return different values
+// for the same function (because there are actually multiple copies of
+// the same function in the address space). To be safe, don't use the
+// results of this function in any == expression. It is only safe to
+// use the result as an address at which to start executing code.
//go:nosplit
func funcPC(f interface{}) uintptr {
return **(**uintptr)(add(unsafe.Pointer(&f), sys.PtrSize))
@@ -3789,8 +3794,8 @@ func setsSP(pc uintptr) bool {
// so assume the worst and stop traceback
return true
}
- switch f.entry {
- case gogoPC, systemstackPC, mcallPC, morestackPC:
+ switch f.funcID {
+ case funcID_gogo, funcID_systemstack, funcID_mcall, funcID_morestack:
return true
}
return false