return mem
case types.TSLICE:
- mem = x.decomposeOne(pos, b, a, mem, x.typs.BytePtr, OpSlicePtr, &rc)
+ mem = x.decomposeOne(pos, b, a, mem, at.Elem().PtrTo(), OpSlicePtr, &rc)
pos = pos.WithNotStmt()
mem = x.decomposeOne(pos, b, a, mem, x.typs.Int, OpSliceLen, &rc)
return x.decomposeOne(pos, b, a, mem, x.typs.Int, OpSliceCap, &rc)
return a
case types.TSLICE:
- addArg(x.rewriteSelectOrArg(pos, b, container, nil, m0, x.typs.BytePtr, rc.next(x.typs.BytePtr)))
+ addArg(x.rewriteSelectOrArg(pos, b, container, nil, m0, at.Elem().PtrTo(), rc.next(x.typs.BytePtr)))
pos = pos.WithNotStmt()
addArg(x.rewriteSelectOrArg(pos, b, container, nil, m0, x.typs.Int, rc.next(x.typs.Int)))
addArg(x.rewriteSelectOrArg(pos, b, container, nil, m0, x.typs.Int, rc.next(x.typs.Int)))
return m0
case types.TSLICE:
- m0 = x.rewriteWideSelectToStores(pos, b, container, m0, x.typs.BytePtr, rc.next(x.typs.BytePtr))
+ m0 = x.rewriteWideSelectToStores(pos, b, container, m0, at.Elem().PtrTo(), rc.next(x.typs.BytePtr))
pos = pos.WithNotStmt()
m0 = x.rewriteWideSelectToStores(pos, b, container, m0, x.typs.Int, rc.next(x.typs.Int))
m0 = x.rewriteWideSelectToStores(pos, b, container, m0, x.typs.Int, rc.next(x.typs.Int))
"testTracebackArgs11b(0xffffffff?, 0xffffffff?, 0x3?, 0x4)",
"testTracebackArgs11b(0x1, 0x2, 0x3, 0x4)"),
},
+ // Make sure spilled slice data pointers are spilled to the right location
+ // to ensure we see it listed without a ?.
+ // See issue 64414.
+ {
+ func() int {
+ poisonStack()
+ return testTracebackArgsSlice(testTracebackArgsSliceBackingStore[:])
+ },
+ // Note: capacity of the slice might be junk, as it is not used.
+ fmt.Sprintf("testTracebackArgsSlice({%p, 0x2, ", &testTracebackArgsSliceBackingStore[0]),
+ },
}
for _, test := range tests {
n := test.fn()
return runtime.Stack(testTracebackArgsBuf[:], false)
}
+// norace to avoid race instrumentation changing spill locations.
+// nosplit to avoid preemption or morestack spilling registers.
+//
+//go:norace
+//go:nosplit
+//go:noinline
+func testTracebackArgsSlice(a []int) int {
+ n := runtime.Stack(testTracebackArgsBuf[:], false)
+ return a[1] + n
+}
+
+var testTracebackArgsSliceBackingStore [2]int
+
// Poison the arg area with deterministic values.
//
//go:noinline