mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: allow write barriers in startpanic_m
We're about to start tracking nowritebarrierrec through systemstack calls, which will reveal write barriers in startpanic_m prohibited by various callers. We actually can allow write barriers here because the write barrier is a no-op when we're panicking. Let the compiler know. Updates #22384. For #22460. Change-Id: Ifb3a38d3dd9a4125c278c3680f8648f987a5b0b8 Reviewed-on: https://go-review.googlesource.com/72770 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
parent
249b5cc945
commit
070cc8eb02
2 changed files with 8 additions and 0 deletions
|
|
@ -654,6 +654,12 @@ func recovery(gp *g) {
|
|||
gogo(&gp.sched)
|
||||
}
|
||||
|
||||
// startpanic_m implements unrecoverable panic.
|
||||
//
|
||||
// It can have write barriers because the write barrier explicitly
|
||||
// ignores writes once dying > 0.
|
||||
//
|
||||
//go:yeswritebarrierrec
|
||||
func startpanic_m() {
|
||||
_g_ := getg()
|
||||
if mheap_.cachealloc.size == 0 { // very early
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue