From 2589dcd888deb37b811a6643e4f4a48d4b575296 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Thu, 15 Nov 2018 12:45:02 +0300 Subject: [PATCH] Fixed lvlhsh test on 64-bit big-endian systems. The nxt_murmur_hash2() generated 4-byte hash that was stored in uintptr_t, which was 8 bytes long on 64-bit systems. At each iteration, it took the previous key and hashed it again. The problem was that it took only the first 4 bytes of the key, and these 4 bytes were always zero on 64-bit big-endian system. That resulted in equal keys at each iteration. The bug was discovered on IBM/S390x. --- nxt/test/lvlhsh_unit_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxt/test/lvlhsh_unit_test.c b/nxt/test/lvlhsh_unit_test.c index 7ed6d6ee..ca750227 100644 --- a/nxt/test/lvlhsh_unit_test.c +++ b/nxt/test/lvlhsh_unit_test.c @@ -196,7 +196,7 @@ static const nxt_mem_proto_t mem_cache_pool_proto = { static nxt_int_t lvlhsh_unit_test(nxt_uint_t n) { - uintptr_t key; + uint32_t key; nxt_uint_t i; nxt_lvlhsh_t lh; nxt_lvlhsh_each_t lhe; -- 2.47.3