diff --git a/src/pkg/reflect/type.go b/src/pkg/reflect/type.go index 5a4ac8cf7c..40d76f99d0 100644 --- a/src/pkg/reflect/type.go +++ b/src/pkg/reflect/type.go @@ -1541,6 +1541,13 @@ func MapOf(key, elem Type) Type { mt.uncommonType = nil mt.ptrToThis = nil mt.zero = unsafe.Pointer(&make([]byte, mt.size)[0]) + mt.gc = unsafe.Pointer(&ptrGC{ + width: unsafe.Sizeof(uintptr(0)), + op: _GC_PTR, + off: 0, + elemgc: mt.hmap.gc, + end: _GC_END, + }) // INCORRECT. Uncomment to check that TestMapOfGC and TestMapOfGCValues // fail when mt.gc is wrong.