From a1520d8bd2b467d5128998a5069611b9e6252653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 24 Mar 2015 17:05:58 +0100 Subject: erts: Fix comparison of exact terms Comparison of exact terms could cause faulty term tests. This was caused by a faulty (too small) internal type. Symptom: -1 = erts_internal:cmp_term(2147483648,0). %% wrong Correct: 1 = erts_internal:cmp_term(2147483648,0). Reported-by: Jesper Louis Andersen --- erts/emulator/beam/erl_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/emulator/beam/erl_map.c') diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c index 5e740aacdd..a180047f6c 100644 --- a/erts/emulator/beam/erl_map.c +++ b/erts/emulator/beam/erl_map.c @@ -400,7 +400,7 @@ BIF_RETTYPE maps_merge_2(BIF_ALIST_2) { Eterm *ks,*vs,*ks1,*vs1,*ks2,*vs2; map_t *mp1,*mp2,*mp_new; Uint n1,n2,i1,i2,need,unused_size=0; - int c = 0; + Sint c = 0; mp1 = (map_t*)map_val(BIF_ARG_1); mp2 = (map_t*)map_val(BIF_ARG_2); @@ -798,7 +798,7 @@ int erts_validate_and_sort_map(map_t* mp) Uint sz = map_get_size(mp); Uint ix,jx; Eterm tmp; - int c; + Sint c; /* sort */ -- cgit v1.2.3