aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-11-03 22:29:36 +0000
committerMichael Knyszek <mknyszek@google.com>2025-11-03 14:50:47 -0800
commitb5353fd90a3824f4ff903e0d89cf4e63714f61d1 (patch)
treef4b675e7c5dc97eda84f88b54220b44129c99654 /src/runtime
parent43491f8d52f13df3c70277f81c85809818969d77 (diff)
downloadgo-b5353fd90a3824f4ff903e0d89cf4e63714f61d1.tar.xz
runtime: don't panic in castogscanstatus
The panic calls gopanic which may have write barriers, but castogscanstatus is called from //go:nowritebarrier contexts. The panic is dead code anyway, and appears immediately before a call to 'throw'. Change-Id: I4a8e296b71bf002295a3aa1db4f723c305ed939a Reviewed-on: https://go-review.googlesource.com/c/go/+/717406 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/proc.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index ef3a0b7a0e..91740d1fa6 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -1254,8 +1254,8 @@ func castogscanstatus(gp *g, oldval, newval uint32) bool {
}
}
print("runtime: castogscanstatus oldval=", hex(oldval), " newval=", hex(newval), "\n")
- throw("castogscanstatus")
- panic("not reached")
+ throw("bad oldval passed to castogscanstatus")
+ return false
}
// casgstatusAlwaysTrack is a debug flag that causes casgstatus to always track