Skip to content

Commit b5353fd

Browse files
committed
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>
1 parent 43491f8 commit b5353fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/proc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,8 @@ func castogscanstatus(gp *g, oldval, newval uint32) bool {
12541254
}
12551255
}
12561256
print("runtime: castogscanstatus oldval=", hex(oldval), " newval=", hex(newval), "\n")
1257-
throw("castogscanstatus")
1258-
panic("not reached")
1257+
throw("bad oldval passed to castogscanstatus")
1258+
return false
12591259
}
12601260

12611261
// casgstatusAlwaysTrack is a debug flag that causes casgstatus to always track

0 commit comments

Comments
 (0)