]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: make funcspdelta inlineable
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 5 Oct 2021 20:52:50 +0000 (13:52 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 5 Oct 2021 23:36:03 +0000 (23:36 +0000)
funcspdelta should be inlined: It is a tiny wrapper around another func.
The sanity check prevents that. Condition the sanity check on debugPcln.
While we're here, make the sanity check throw when it fails.

Change-Id: Iec022b8463b13a8e5a6d8479e7ddcb68909d6fe0
Reviewed-on: https://go-review.googlesource.com/c/go/+/354133
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/symtab.go

index 7724f0d2f0b3d5db8bf5948355f1de02fe9eed63..8d21fdc42cd4d04d46c0ddd8e25df7489ad6f207 100644 (file)
@@ -1035,8 +1035,9 @@ func funcline(f funcInfo, targetpc uintptr) (file string, line int32) {
 
 func funcspdelta(f funcInfo, targetpc uintptr, cache *pcvalueCache) int32 {
        x, _ := pcvalue(f, f.pcsp, targetpc, cache, true)
-       if x&(goarch.PtrSize-1) != 0 {
+       if debugPcln && x&(goarch.PtrSize-1) != 0 {
                print("invalid spdelta ", funcname(f), " ", hex(f.entry()), " ", hex(targetpc), " ", hex(f.pcsp), " ", x, "\n")
+               throw("bad spdelta")
        }
        return x
 }