aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-02-17 19:11:24 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:24 +0100
commit7e3c3c7106095cc5afdbd5cd7e96b907784ada01 (patch)
treebb358315b0df13e756446cf2dd27a30b72e7fd57 /erts/emulator/beam
parent354ec7fe8ee31cde73c811bd5dea4f3e6787d10a (diff)
downloadotp-7e3c3c7106095cc5afdbd5cd7e96b907784ada01.tar.gz
otp-7e3c3c7106095cc5afdbd5cd7e96b907784ada01.tar.bz2
otp-7e3c3c7106095cc5afdbd5cd7e96b907784ada01.zip
erts: Fix bug in hashmap_restore/shift_hash
Deep hashing should ignore the three lowest bits of the level.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_hashmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_hashmap.c b/erts/emulator/beam/erl_hashmap.c
index 583ff52c26..6bca2f1665 100644
--- a/erts/emulator/beam/erl_hashmap.c
+++ b/erts/emulator/beam/erl_hashmap.c
@@ -51,9 +51,9 @@
#define hashmap_make_hash(Key) make_hash_vsn(Key, 3)
#define hashmap_restore_hash(Heap,Lvl,Key) \
- ((Lvl) < 8) ? hashmap_make_hash(Key) >> (4*(Lvl)) : hashmap_make_hash(CONS(Heap, make_small(Lvl), (Key))) >> (4*((Lvl) & 7))
+ (((Lvl) < 8) ? hashmap_make_hash(Key) >> (4*(Lvl)) : hashmap_make_hash(CONS(Heap, make_small((Lvl)>>3), (Key))) >> (4*((Lvl) & 7)))
#define hashmap_shift_hash(Heap,Hx,Lvl,Key) \
- ((++(Lvl)) & 7) ? (Hx) >> 4 : hashmap_make_hash(CONS(Heap, make_small(Lvl), Key))
+ (((++(Lvl)) & 7) ? (Hx) >> 4 : hashmap_make_hash(CONS(Heap, make_small((Lvl)>>3), Key)))
#if 0
static char *format_binary(Uint64 x, char *b) {