1
0
mirror of https://github.com/golang/go synced 2024-11-18 01:54:45 -07:00

runtime: fix stack split at bad time when disable inlining

key32 is called between entersyscallblock and exitsyscall
stack split may occur if disable inlining and the G is preempted

Fix the problem by describing key32 as nosplit function

Fixes #20510

Change-Id: I1f0787995936f34ef0052cf79fde036f1b338865
Reviewed-on: https://go-review.googlesource.com/44390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Wei Xiao 2017-05-25 13:59:39 +08:00 committed by Ian Lance Taylor
parent 9acd814c2a
commit 91a80cc174

View File

@ -38,6 +38,7 @@ const (
// affect mutex's state.
// We use the uintptr mutex.key and note.key as a uint32.
//go:nosplit
func key32(p *uintptr) *uint32 {
return (*uint32)(unsafe.Pointer(p))
}