From d2ba8674603bc4ef210ec91e6f51924f7efe8c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Mon, 18 Apr 2016 19:19:23 +0200 Subject: 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. --- lib/hipe/cerl/erl_types.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/hipe') 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(). -- cgit v1.2.3