From 04575ce53f9af22403371b1b67d1e8bda990a4cd Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Sat, 28 Oct 2023 16:30:57 +0000 Subject: [PATCH] reflect: pass the right element type in verifyGCBitsSlice Currently verifyGCBitsSlice creates a new array type to represent the slice backing store, but passes the element type as the slice type in this construction. This is incorrect, but the tests currently don't care about it. They will in a follow-up CL, so fix it now. Change-Id: I6ed8a9808ae78c624be316db1566376fa0e12758 Reviewed-on: https://go-review.googlesource.com/c/go/+/537981 Reviewed-by: Cherry Mui Reviewed-by: Keith Randall Auto-Submit: Michael Knyszek LUCI-TryBot-Result: Go LUCI --- src/reflect/all_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index c2a987f45e..5bff2efbc4 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -7042,7 +7042,7 @@ func verifyGCBitsSlice(t *testing.T, typ Type, cap int, bits []byte) { // repeat a bitmap for a small array or executing a repeat in // a GC program. val := MakeSlice(typ, 0, cap) - data := NewAt(ArrayOf(cap, typ), val.UnsafePointer()) + data := NewAt(ArrayOf(cap, typ.Elem()), val.UnsafePointer()) heapBits := GCBits(data.Interface()) // Repeat the bitmap for the slice size, trimming scalars in // the last element. -- 2.44.0