From: Michael Munday Date: Tue, 29 Aug 2017 04:10:17 +0000 (+0100) Subject: runtime: fix memhash64 on big endian systems X-Git-Tag: go1.10beta1~1295 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=176cd48e574817bbb912c139396324c187b31279;p=gostls13.git runtime: fix memhash64 on big endian systems Fixes #21677. Change-Id: I869dee5f43df5d87d86922681726297e3024c562 Reviewed-on: https://go-review.googlesource.com/59810 Run-TryBot: Michael Munday Reviewed-by: Martin Möhrmann TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/hash64.go b/src/runtime/hash64.go index 22085d3df0..3cf3f4629b 100644 --- a/src/runtime/hash64.go +++ b/src/runtime/hash64.go @@ -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