1
0
mirror of https://github.com/golang/go synced 2024-11-12 05:40:22 -07:00

runtime: mark TestTracebackArgs test functions nosplit

The argument liveness tests expect outputs where a dead stack slot
has a poisoned value. If the test function is preempted at the
prologue, it will go with the morestack code path which will spill
all the argument registers. Mark them nosplit to avoid that.

Should fix #49354.

Change-Id: I3b13e72e925748687a53c494bfaa70f07d9496fa
Reviewed-on: https://go-review.googlesource.com/c/go/+/361211
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Cherry Mui 2021-11-04 16:53:30 -04:00
parent f249fa27a9
commit c58417b97f

View File

@ -353,6 +353,9 @@ func testTracebackArgs8d(a testArgsType8d) int {
return n
}
// nosplit to avoid preemption or morestack spilling registers.
//
//go:nosplit
//go:noinline
func testTracebackArgs9(a int64, b int32, c int16, d int8, x [2]int, y int) int {
if a < 0 {
@ -366,6 +369,9 @@ func testTracebackArgs9(a int64, b int32, c int16, d int8, x [2]int, y int) int
return n
}
// nosplit to avoid preemption or morestack spilling registers.
//
//go:nosplit
//go:noinline
func testTracebackArgs10(a, b, c, d, e int32) int {
// no use of any args
@ -373,8 +379,10 @@ func testTracebackArgs10(a, b, c, d, e int32) int {
}
// norace to avoid race instrumentation changing spill locations.
// nosplit to avoid preemption or morestack spilling registers.
//
//go:norace
//go:nosplit
//go:noinline
func testTracebackArgs11a(a, b, c int32) int {
if a < 0 {
@ -387,8 +395,10 @@ func testTracebackArgs11a(a, b, c int32) int {
}
// norace to avoid race instrumentation changing spill locations.
// nosplit to avoid preemption or morestack spilling registers.
//
//go:norace
//go:nosplit
//go:noinline
func testTracebackArgs11b(a, b, c, d int32) int {
var x int32