Skip to content

Commit a6b90a0

Browse files
mknyszekpull[bot]
authored andcommitted
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 <[email protected]> Reviewed-by: Keith Randall <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent b9c30c7 commit a6b90a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reflect/all_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7042,7 +7042,7 @@ func verifyGCBitsSlice(t *testing.T, typ Type, cap int, bits []byte) {
70427042
// repeat a bitmap for a small array or executing a repeat in
70437043
// a GC program.
70447044
val := MakeSlice(typ, 0, cap)
7045-
data := NewAt(ArrayOf(cap, typ), val.UnsafePointer())
7045+
data := NewAt(ArrayOf(cap, typ.Elem()), val.UnsafePointer())
70467046
heapBits := GCBits(data.Interface())
70477047
// Repeat the bitmap for the slice size, trimming scalars in
70487048
// the last element.

0 commit comments

Comments
 (0)