From 2a5d4ea97e0dd6f1e192aac081430b848084521b Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 5 Oct 2021 13:52:50 -0700 Subject: [PATCH] runtime: make funcspdelta inlineable 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 Run-TryBot: Josh Bleecher Snyder TryBot-Result: Go Bot Reviewed-by: Cherry Mui --- src/runtime/symtab.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 7724f0d2f0..8d21fdc42c 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -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 } -- 2.48.1