1
0
mirror of https://github.com/golang/go synced 2024-11-23 04:30:03 -07:00

runtime: fix memhash64 on big endian systems

Fixes #21677.

Change-Id: I869dee5f43df5d87d86922681726297e3024c562
Reviewed-on: https://go-review.googlesource.com/59810
Run-TryBot: Michael Munday <mike.munday@ibm.com>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Munday 2017-08-29 05:10:17 +01:00
parent b7397c8100
commit 176cd48e57

View File

@ -95,7 +95,7 @@ func memhash32(p unsafe.Pointer, seed uintptr) uintptr {
func memhash64(p unsafe.Pointer, seed uintptr) uintptr {
h := uint64(seed + 8*hashkey[0])
h ^= readUnaligned64(p)
h ^= uint64(readUnaligned32(p)) | uint64(readUnaligned32(add(p, 4)))<<32
h = rotl_31(h*m1) * m2
h ^= h >> 29
h *= m3