From: Wei Xiao Date: Thu, 25 May 2017 05:59:39 +0000 (+0800) Subject: runtime: fix stack split at bad time when disable inlining X-Git-Tag: go1.9beta1~146 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=91a80cc174dc2b0df4cab12966c498ac435dbc31;p=gostls13.git 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 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- 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)) }