mirror of
https://github.com/golang/go.git
synced 2026-04-03 01:40:30 +09:00
cmd/compile: don't call memclrNoHeapPointersPreemptible from nosplit functions
That function will allow preemption, which could subsequently allow for a stack copy (from shrinking). We can't let that happen inside a nosplit function. Update #78081 Change-Id: I12e77b50bbdcdd1e08e505a863b13cd9e1f814ee Reviewed-on: https://go-review.googlesource.com/c/go/+/756123 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Keith Randall <khr@golang.org>
This commit is contained in:
committed by
Gopher Robot
parent
cd2fa3b48d
commit
adf9c27874
@@ -723,6 +723,8 @@ func extendSlice(n *ir.CallExpr, init *ir.Nodes) ir.Node {
|
||||
if hasPointers {
|
||||
clrname = "memclrHasPointers"
|
||||
ir.CurFunc.SetWBPos(n.Pos())
|
||||
} else if ir.CurFunc.Pragma&ir.Nosplit != 0 {
|
||||
clrname = "memclrNoHeapPointers"
|
||||
}
|
||||
|
||||
var clr ir.Nodes
|
||||
|
||||
@@ -588,6 +588,8 @@ func arrayClear(wbPos src.XPos, a ir.Node, nrange *ir.RangeStmt) ir.Node {
|
||||
// memclrHasPointers(hp, hn)
|
||||
ir.CurFunc.SetWBPos(wbPos)
|
||||
fn = mkcallstmt("memclrHasPointers", hp, hn)
|
||||
} else if ir.CurFunc.Pragma&ir.Nosplit != 0 {
|
||||
fn = mkcallstmt("memclrNoHeapPointers", hp, hn)
|
||||
} else {
|
||||
// memclrNoHeapPointersPreemptible(hp, hn)
|
||||
fn = mkcallstmt("memclrNoHeapPointersPreemptible", hp, hn)
|
||||
|
||||
Reference in New Issue
Block a user