aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-04-07 17:05:46 +0200
committerSverker Eriksson <[email protected]>2015-04-07 17:05:46 +0200
commit6492bf35902f476ef0eac972ef49c424fa6d8bc6 (patch)
tree01714865ab45ad6781a8dad0d1d013baef940b22 /erts/emulator
parent7d46bab86ad0d71d79363815d7b7d7a8c1660d5a (diff)
downloadotp-6492bf35902f476ef0eac972ef49c424fa6d8bc6.tar.gz
otp-6492bf35902f476ef0eac972ef49c424fa6d8bc6.tar.bz2
otp-6492bf35902f476ef0eac972ef49c424fa6d8bc6.zip
erts: Fix bug in binary_to_term for big maps with 32 bit hash-clash
binary_to_term threw badarg as the "reject_dupkey" case in hashmap_from_unsored_array was always triggered when hash-clash was found as the first round in the loop compared the key with itself.
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index 20a17bcd24..4acf830655 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -568,14 +568,14 @@ static Eterm hashmap_from_unsorted_array(ErtsHeapFactory* factory,
while(ix < jx) {
lx = ix;
- while(ix < jx && EQ(CAR(list_val(hxns[ix].val)), CAR(list_val(hxns[lx].val)))) {
+ while(++ix < jx && EQ(CAR(list_val(hxns[ix].val)),
+ CAR(list_val(hxns[lx].val)))) {
if (reject_dupkeys)
return THE_NON_VALUE;
if (hxns[ix].i > hxns[lx].i) {
lx = ix;
}
- ix++;
}
hxns[cx].hx = hxns[lx].hx;
hxns[cx].val = hxns[lx].val;