diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-04-07 12:58:15 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-04-07 13:09:20 +0200 |
commit | 30ed5b1cc6aa0efe6ac099b66d33d46c7c0c6b47 (patch) | |
tree | 31e1431e9085b01b536839c9076c089d7bc0ae77 /erts/emulator/test | |
parent | cc722af4d62d749d2a75155e91a2a1562aeb2a5a (diff) | |
download | otp-30ed5b1cc6aa0efe6ac099b66d33d46c7c0c6b47.tar.gz otp-30ed5b1cc6aa0efe6ac099b66d33d46c7c0c6b47.tar.bz2 otp-30ed5b1cc6aa0efe6ac099b66d33d46c7c0c6b47.zip |
erts: Fix deep colliding hash values in maps:from_list/1
Reported-by: Jesper Louis Andersen
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/map_SUITE.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/erts/emulator/test/map_SUITE.erl b/erts/emulator/test/map_SUITE.erl index dc6286fdb6..f061b177c5 100644 --- a/erts/emulator/test/map_SUITE.erl +++ b/erts/emulator/test/map_SUITE.erl @@ -1888,11 +1888,19 @@ t_bif_map_merge(Config) when is_list(Config) -> M8 = maps:merge(M7,M8), M8 = maps:merge(M8,M8), + %% maps:merge/2 and mixed + + Ks1 = [764492191,2361333849], %% deep collision + Ks2 = lists:seq(1,33), + M9 = maps:from_list([{K,K}||K <- Ks1]), + M10 = maps:from_list([{K,K}||K <- Ks2]), + M11 = maps:merge(M9,M10), + ok = check_keys_exist(Ks1 ++ Ks2, M11), + %% error case {'EXIT',{badarg,[{maps,merge,_,_}|_]}} = (catch maps:merge((1 bsl 65 + 3), <<>>)), {'EXIT',{badarg,[{maps,merge,_,_}|_]}} = (catch maps:merge(<<>>, id(#{ a => 1}))), {'EXIT',{badarg,[{maps,merge,_,_}|_]}} = (catch maps:merge(id(#{ a => 2}), <<>> )), - ok. |