aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2013-12-12 13:24:05 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-01-29 11:08:43 +0100
commit701ed39cc53e40783c4b48c83f9f686eb2668d38 (patch)
tree3c86dd75322eeabeb4283e5b58be850c0ca1f2b0
parentf1003b26524c2321b1eef36fb2d3997aaf0b9e10 (diff)
downloadotp-701ed39cc53e40783c4b48c83f9f686eb2668d38.tar.gz
otp-701ed39cc53e40783c4b48c83f9f686eb2668d38.tar.bz2
otp-701ed39cc53e40783c4b48c83f9f686eb2668d38.zip
compiler: Fix term order compiler for maps
-rw-r--r--lib/compiler/src/v3_codegen.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl
index db8ea04778..c8735a76e8 100644
--- a/lib/compiler/src/v3_codegen.erl
+++ b/lib/compiler/src/v3_codegen.erl
@@ -1572,7 +1572,7 @@ cg_map_pairs(Es0) ->
end || {_,Vs} <- R2],
%% R3 is now [{Op,{Key,Value}}]
- R = lists:sort(R3),
+ R = termsort(R3),
%% R4 is now sorted with all alloc first in the list, followed by
%% all exact.
@@ -1611,6 +1611,9 @@ map_pair_op_and_key(L) ->
{assoc,K}
end.
+termsort(Ls) ->
+ lists:sort(fun(A,B) -> erts_internal:cmp_term(A,B) < 0 end, Ls).
+
%%%
%%% Code generation for constructing binaries.
%%%