diff --git a/src/runtime/alg.go b/src/runtime/alg.go index d8789b4b5f..5a0656513d 100644 --- a/src/runtime/alg.go +++ b/src/runtime/alg.go @@ -160,7 +160,15 @@ func nilinterhash(p unsafe.Pointer, h uintptr) uintptr { // maps generated by reflect.MapOf (reflect_typehash, below). func typehash(t *_type, p unsafe.Pointer, h uintptr) uintptr { if t.tflag&tflagRegularMemory != 0 { - return memhash(p, h, t.size) + // Handle ptr sizes specially, see issue 37086. + switch t.size { + case 4: + return memhash32(p, h) + case 8: + return memhash64(p, h) + default: + return memhash(p, h, t.size) + } } switch t.kind & kindMask { case kindFloat32: