From: Cherry Mui Date: Thu, 4 Nov 2021 20:53:30 +0000 (-0400) Subject: runtime: mark TestTracebackArgs test functions nosplit X-Git-Tag: go1.18beta1~512 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c58417b97f2b8d16176ddd294ae4471f834ab4d6;p=gostls13.git 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 Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Austin Clements --- diff --git a/src/runtime/traceback_test.go b/src/runtime/traceback_test.go index 0333b85c56..7d8b04e14b 100644 --- a/src/runtime/traceback_test.go +++ b/src/runtime/traceback_test.go @@ -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