]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: mark TestTracebackArgs test functions nosplit
authorCherry Mui <cherryyz@google.com>
Thu, 4 Nov 2021 20:53:30 +0000 (16:53 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 5 Nov 2021 16:51:14 +0000 (16:51 +0000)
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>
src/runtime/traceback_test.go

index 0333b85c56c75287e762241b8cb48ca57f111e66..7d8b04e14b732e2b1615f115cf563d92d9f1c4dd 100644 (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