aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.
%%%