aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-08-21 09:26:56 +0200
committerHans Bolinder <[email protected]>2014-08-21 09:26:56 +0200
commit305bfc3360acfae8af75b36e00c61298b6ea582e (patch)
tree11300443a664f962db49adbc1123dd9d69a50e49 /lib/dialyzer/src
parentdaed987f7ebae3fc8f969b4f55f225837267411b (diff)
parent6eac68854c414285b7a99f27196bbbfa7969b295 (diff)
downloadotp-305bfc3360acfae8af75b36e00c61298b6ea582e.tar.gz
otp-305bfc3360acfae8af75b36e00c61298b6ea582e.tar.bz2
otp-305bfc3360acfae8af75b36e00c61298b6ea582e.zip
Merge branch 'hb/dialyzer/bugfixes/OTP-12018' into maint
* hb/dialyzer/bugfixes/OTP-12018: dialyzer, hipe: Fix a bug concerning is_record/2,3
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r--lib/dialyzer/src/dialyzer_dataflow.erl18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl
index 92aab68ad6..03005e689f 100644
--- a/lib/dialyzer/src/dialyzer_dataflow.erl
+++ b/lib/dialyzer/src/dialyzer_dataflow.erl
@@ -93,6 +93,8 @@
-define(TYPE_LIMIT, 3).
+-define(BITS, 128).
+
-record(state, {callgraph :: dialyzer_callgraph:callgraph(),
envs :: env_tab(),
fun_tab :: fun_tab(),
@@ -1610,10 +1612,18 @@ bind_bin_segs([Seg|Segs], BinType, Acc, Map, State) ->
SizeVal = lists:max(List),
Flags = cerl:concrete(cerl:bitstr_flags(Seg)),
N = SizeVal * UnitVal,
- case lists:member(signed, Flags) of
- true -> t_from_range(-(1 bsl (N - 1)), 1 bsl (N - 1) - 1);
- false -> t_from_range(0, 1 bsl N - 1)
- end
+ case N >= ?BITS of
+ true ->
+ case lists:member(signed, Flags) of
+ true -> t_from_range(neg_inf, pos_inf);
+ false -> t_from_range(0, pos_inf)
+ end;
+ false ->
+ case lists:member(signed, Flags) of
+ true -> t_from_range(-(1 bsl (N - 1)), 1 bsl (N - 1) - 1);
+ false -> t_from_range(0, 1 bsl N - 1)
+ end
+ end
end
end,
{Map2, [_]} = bind_pat_vars([Val], [ValConstr], [], Map1, State, false),