From 176cd48e574817bbb912c139396324c187b31279 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 29 Aug 2017 05:10:17 +0100 Subject: [PATCH] runtime: fix memhash64 on big endian systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/runtime/hash64.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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