diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index 9a5d9363ffa17489921d37d68117cdbbedeb4ec5..6df0bbfabebac068290e0e4898e612405bb8fcb9 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)