aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/panic.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-07-20 13:49:17 -0400
committerMichael Pratt <mpratt@google.com>2022-08-02 18:52:03 +0000
commit4400238ec8ef3f0d2609bbd18ea57d6c5d097f1d (patch)
treeaddacd410bdf3f1b5b13e46870ef58284760364c /src/runtime/panic.go
parent5999a28de80cf685b037e53c8dc9a511f11fe7b2 (diff)
downloadgo-4400238ec8ef3f0d2609bbd18ea57d6c5d097f1d.tar.xz
runtime: trivial replacements of _g_ in remaining files
Change-Id: I24d299b345bda1c9d6fa7876d4f03c05b8c1156d Reviewed-on: https://go-review.googlesource.com/c/go/+/418587 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r--src/runtime/panic.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go
index e7eee82df6..3783e3dede 100644
--- a/src/runtime/panic.go
+++ b/src/runtime/panic.go
@@ -1190,7 +1190,7 @@ func fatalpanic(msgs *_panic) {
//
//go:nowritebarrierrec
func startpanic_m() bool {
- _g_ := getg()
+ gp := getg()
if mheap_.cachealloc.size == 0 { // very early
print("runtime: panic before malloc heap initialized\n")
}
@@ -1198,18 +1198,18 @@ func startpanic_m() bool {
// could happen in a signal handler, or in a throw, or inside
// malloc itself. We want to catch if an allocation ever does
// happen (even if we're not in one of these situations).
- _g_.m.mallocing++
+ gp.m.mallocing++
// If we're dying because of a bad lock count, set it to a
// good lock count so we don't recursively panic below.
- if _g_.m.locks < 0 {
- _g_.m.locks = 1
+ if gp.m.locks < 0 {
+ gp.m.locks = 1
}
- switch _g_.m.dying {
+ switch gp.m.dying {
case 0:
// Setting dying >0 has the side-effect of disabling this G's writebuf.
- _g_.m.dying = 1
+ gp.m.dying = 1
atomic.Xadd(&panicking, 1)
lock(&paniclk)
if debug.schedtrace > 0 || debug.scheddetail > 0 {
@@ -1220,13 +1220,13 @@ func startpanic_m() bool {
case 1:
// Something failed while panicking.
// Just print a stack trace and exit.
- _g_.m.dying = 2
+ gp.m.dying = 2
print("panic during panic\n")
return false
case 2:
// This is a genuine bug in the runtime, we couldn't even
// print the stack trace successfully.
- _g_.m.dying = 3
+ gp.m.dying = 3
print("stack trace unavailable\n")
exit(4)
fallthrough