diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-04-06 14:04:45 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-04-06 16:37:24 -0700 |
commit | 52fa80f853c0b0f623ea9e4c7198e324ce44ff30 (patch) | |
tree | e2695726e95b7bd125d52b7bdd315cb0028854fa /libgo/go/runtime/alg.go | |
parent | 749bd22ddc50b5112e5ed506ffef7249bf8e6fb3 (diff) | |
download | gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.zip gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.gz gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.bz2 |
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
Diffstat (limited to 'libgo/go/runtime/alg.go')
-rw-r--r-- | libgo/go/runtime/alg.go | 12 |
1 files changed, 11 insertions, 1 deletions
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: |