diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go index e8e61a7fd1..c36ff470d6 100644 --- a/src/runtime/hashmap.go +++ b/src/runtime/hashmap.go @@ -1166,10 +1166,12 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { b = (*bmap)(add(h.oldbuckets, oldbucket*uintptr(t.bucketsize))) // Preserve b.tophash because the evacuation // state is maintained there. + ptr := add(unsafe.Pointer(b), dataOffset) + n := uintptr(t.bucketsize) - dataOffset if t.bucket.kind&kindNoPointers == 0 { - memclrHasPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset) + memclrHasPointers(ptr, n) } else { - memclrNoHeapPointers(add(unsafe.Pointer(b), dataOffset), uintptr(t.bucketsize)-dataOffset) + memclrNoHeapPointers(ptr, n) } } }