aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/cerl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-04-18 19:19:23 +0200
committerHans Bolinder <[email protected]>2016-04-28 16:16:10 +0200
commitd2ba8674603bc4ef210ec91e6f51924f7efe8c2e (patch)
tree3bf92f18425dcf38291ba452b3b322ae407cda55 /lib/hipe/cerl
parent12f968890c34e2591e7d4d8797896878f6cb6c62 (diff)
downloadotp-d2ba8674603bc4ef210ec91e6f51924f7efe8c2e.tar.gz
otp-d2ba8674603bc4ef210ec91e6f51924f7efe8c2e.tar.bz2
otp-d2ba8674603bc4ef210ec91e6f51924f7efe8c2e.zip
erl_types: Fix crash merging maps with opaque keys
Opaque keys in maps broke an assumption in erl_types:mapmerge_otherv/3 (that the infinimum of a singleton type and some other type would either be none() or that same singleton type), causing a case_clause crash.
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r--lib/hipe/cerl/erl_types.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index ea69e54c83..8057e37d0c 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -1821,8 +1821,8 @@ map_pairwise_merge_foldr(F, AccIn, As0, ADefK, ADefV, Bs0, BDefK, BDefV) ->
%% cases, at the cost of the creation of more tuples:
mapmerge_otherv(K, ODefK, ODefV) ->
case t_inf(K, ODefK) of
- ?none -> ?none;
- K -> ODefV
+ ?none -> ?none;
+ _KOrOpaque -> ODefV
end.
-spec t_map_put({erl_type(), erl_type()}, erl_type()) -> erl_type().