aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2011-05-03 17:44:59 +0300
committerStavros Aronis <[email protected]>2011-05-13 09:25:32 +0300
commit3a7af1c4934c0ce4682d88a6dafc178c1d12a703 (patch)
tree3b13be97a6303e7f3212666004d481e90b5ea88b /lib/dialyzer/src
parent5703c55ea47c52a8dc8475085a8657422da3535e (diff)
downloadotp-3a7af1c4934c0ce4682d88a6dafc178c1d12a703.tar.gz
otp-3a7af1c4934c0ce4682d88a6dafc178c1d12a703.tar.bz2
otp-3a7af1c4934c0ce4682d88a6dafc178c1d12a703.zip
Fix server loop detection
Dialyzer does not normally emit warnings for functions that implement non-terminating server loops. This detection failed when some of the elements in an SCC terminated normally (being for example list comprehensions or other generic anonymous functions that were included in the SCC). This patch fixes that.
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r--lib/dialyzer/src/dialyzer_typesig.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl
index c45615d670..65c2ff76bb 100644
--- a/lib/dialyzer/src/dialyzer_typesig.erl
+++ b/lib/dialyzer/src/dialyzer_typesig.erl
@@ -1684,11 +1684,14 @@ solve_scc(SCC, Map, State, TryingUnit) ->
true ->
?debug("SCC ~w reached fixpoint\n", [SCC]),
NewTypes = unsafe_lookup_type_list(Funs, Map2),
- case lists:all(fun(T) -> t_is_none(t_fun_range(T)) end, NewTypes)
+ case erl_types:any_none([t_fun_range(T) || T <- NewTypes])
andalso TryingUnit =:= false of
true ->
- UnitTypes = [t_fun(state__fun_arity(F, State), t_unit())
- || F <- Funs],
+ UnitTypes =
+ [case t_is_none(t_fun_range(T)) of
+ false -> T;
+ true -> t_fun(t_fun_args(T), t_unit())
+ end || T <- NewTypes],
Map3 = enter_type_lists(Funs, UnitTypes, Map2),
solve_scc(SCC, Map3, State, true);
false ->