aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-04-19 15:02:17 +0200
committerHans Bolinder <[email protected]>2016-04-28 16:16:10 +0200
commit29253c06dd99717e8424c0418144fd95d232c38d (patch)
treeff4f7a891ba26d05a8479936a073610cbf8cb760 /lib/hipe
parentd2ba8674603bc4ef210ec91e6f51924f7efe8c2e (diff)
downloadotp-29253c06dd99717e8424c0418144fd95d232c38d.tar.gz
otp-29253c06dd99717e8424c0418144fd95d232c38d.tar.bz2
otp-29253c06dd99717e8424c0418144fd95d232c38d.zip
erl_types: Fix t_subtract/2 correctness bug
t_subtract/2 would break its postcondition by always returning the underapproximation none() when given a variable on the right hand side. This broke map type parsing, since it relied on t_subtract/2 to tell it when map keys would shadow each other.
Diffstat (limited to 'lib/hipe')
-rw-r--r--lib/hipe/cerl/erl_types.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 8057e37d0c..1f0bc7eda1 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -3694,7 +3694,7 @@ t_subtract_list(T, []) ->
-spec t_subtract(erl_type(), erl_type()) -> erl_type().
t_subtract(_, ?any) -> ?none;
-t_subtract(_, ?var(_)) -> ?none;
+t_subtract(T, ?var(_)) -> T;
t_subtract(?any, _) -> ?any;
t_subtract(?var(_) = T, _) -> T;
t_subtract(T, ?unit) -> T;