aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/lock_futex.go
diff options
context:
space:
mode:
authorWei Xiao <Wei.Xiao@arm.com>2017-05-25 13:59:39 +0800
committerIan Lance Taylor <iant@golang.org>2017-05-29 19:10:39 +0000
commit91a80cc174dc2b0df4cab12966c498ac435dbc31 (patch)
tree94b1b04d46a66bbcc67e7244ecdefcb584751d07 /src/runtime/lock_futex.go
parent9acd814c2a53a10de39a891bf7b6f4d12fc7b329 (diff)
downloadgo-91a80cc174dc2b0df4cab12966c498ac435dbc31.tar.gz
go-91a80cc174dc2b0df4cab12966c498ac435dbc31.zip
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>
Diffstat (limited to 'src/runtime/lock_futex.go')
-rw-r--r--src/runtime/lock_futex.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/lock_futex.go b/src/runtime/lock_futex.go
index 45d3da64a4..9d55bd129c 100644
--- a/src/runtime/lock_futex.go
+++ b/src/runtime/lock_futex.go
@@ -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))
}