aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_dataflow.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-08-21 09:29:50 +0200
committerHans Bolinder <[email protected]>2014-08-21 09:29:50 +0200
commit05d8ce4d317df08076433296449083e9848b4d2d (patch)
tree8b9a919d8dd337b2da74ee3c8e4f19aa6a04e689 /lib/dialyzer/src/dialyzer_dataflow.erl
parent0f0befab60ccd0bb75972932299a2b4c0522325a (diff)
parent305bfc3360acfae8af75b36e00c61298b6ea582e (diff)
downloadotp-05d8ce4d317df08076433296449083e9848b4d2d.tar.gz
otp-05d8ce4d317df08076433296449083e9848b4d2d.tar.bz2
otp-05d8ce4d317df08076433296449083e9848b4d2d.zip
Merge branch 'maint'
* maint: dialyzer, hipe: Fix a bug concerning is_record/2,3
Diffstat (limited to 'lib/dialyzer/src/dialyzer_dataflow.erl')
-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 9df9aca69f..46467a1303 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),