From: Michael Anthony Knyszek Date: Mon, 3 Nov 2025 22:29:36 +0000 (+0000) Subject: runtime: don't panic in castogscanstatus X-Git-Tag: go1.26rc1~391 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b5353fd90a;p=gostls13.git 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 Reviewed-by: Cherry Mui --- 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