aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-07-20 13:18:54 -0400
committerMichael Pratt <mpratt@google.com>2022-08-02 18:52:13 +0000
commit399f50c9d773e17221e0c80ba1d739c5575c8460 (patch)
tree495d1954d39bcb741bfeff05ad7f864e70afc38c
parent4509e951ecc4bb81b8463829a639c051c2b967f4 (diff)
downloadgo-399f50c9d773e17221e0c80ba1d739c5575c8460.tar.gz
go-399f50c9d773e17221e0c80ba1d739c5575c8460.zip
runtime: tricky replacements of g in traceback.go
Change-Id: I80e847451b697de049a01df051a73b5976b39d4a Reviewed-on: https://go-review.googlesource.com/c/go/+/418589 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
-rw-r--r--src/runtime/traceback.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index 9a5d9363ff..6df0bbfabe 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -923,8 +923,8 @@ func gcallers(gp *g, skip int, pcbuf []uintptr) int {
// showframe reports whether the frame with the given characteristics should
// be printed during a traceback.
func showframe(f funcInfo, gp *g, firstFrame bool, funcID, childID funcID) bool {
- g := getg()
- if g.m.throwing >= throwTypeRuntime && gp != nil && (gp == g.m.curg || gp == g.m.caughtsig.ptr()) {
+ mp := getg().m
+ if mp.throwing >= throwTypeRuntime && gp != nil && (gp == mp.curg || gp == mp.caughtsig.ptr()) {
return true
}
return showfuncinfo(f, firstFrame, funcID, childID)