From 52fa80f853c0b0f623ea9e4c7198e324ce44ff30 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 6 Apr 2020 14:04:45 -0700 Subject: libgo: update to almost the 1.14.2 release Update to edea4a79e8d7dea2456b688f492c8af33d381dc2 which is likely to be approximately the 1.14.2 release. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227377 --- libgo/go/runtime/alg.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libgo/go/runtime/alg.go') diff --git a/libgo/go/runtime/alg.go b/libgo/go/runtime/alg.go index 101402c..95f02aa 100644 --- a/libgo/go/runtime/alg.go +++ b/libgo/go/runtime/alg.go @@ -176,9 +176,19 @@ func nilinterhash(p unsafe.Pointer, h uintptr) uintptr { // is slower but more general and is used for hashing interface types // (called from interhash or nilinterhash, above) or for hashing in // maps generated by reflect.MapOf (reflect_typehash, below). +// Note: this function must match the compiler generated +// functions exactly. See issue 37716. 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: -- cgit v1.1