diff options
author | Hans Bolinder <[email protected]> | 2016-06-09 09:18:35 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2016-06-09 09:18:35 +0200 |
commit | 7f2a5750d896febf39a51c488f57c4235e34a040 (patch) | |
tree | 14adc52f4466bd8a58caaadb289f295d9ea6edfb /lib/dialyzer/src | |
parent | 8de8b36d4a19a79dd1bd1b49a4c394348edd9eac (diff) | |
parent | 6a0d7e9abef8474ae1de739868ecb2245e8aa6a8 (diff) | |
download | otp-7f2a5750d896febf39a51c488f57c4235e34a040.tar.gz otp-7f2a5750d896febf39a51c488f57c4235e34a040.tar.bz2 otp-7f2a5750d896febf39a51c488f57c4235e34a040.zip |
Merge branch 'hasse/dialyzer/fix_constraint_loop/ERL-157/OTP-13653'
* hasse/dialyzer/fix_constraint_loop/ERL-157/OTP-13653:
Dialyzer: Fix a bug that caused Dialyzer to go into an infinite loop.
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r-- | lib/dialyzer/src/dialyzer_contracts.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/dialyzer/src/dialyzer_contracts.erl b/lib/dialyzer/src/dialyzer_contracts.erl index d1ffa07706..272ad10e90 100644 --- a/lib/dialyzer/src/dialyzer_contracts.erl +++ b/lib/dialyzer/src/dialyzer_contracts.erl @@ -591,10 +591,13 @@ remove_uses([{Var, Use}|ToRemove], Constrs0) -> remove_uses(_Var, _Use, []) -> []; remove_uses(Var, Use, [Constr|Constrs]) -> {V, Form} = Constr, - case erl_types:t_var_name(V) =:= Var of - true -> [{V, remove_use(Form, Use)}|Constrs]; - false -> [Constr|remove_uses(Var, Use, Constrs)] - end. + NewConstr = case erl_types:t_var_name(V) =:= Var of + true -> + {V, remove_use(Form, Use)}; + false -> + Constr + end, + [NewConstr|remove_uses(Var, Use, Constrs)]. remove_use({var, L, V}, V) -> {var, L, '_'}; remove_use(T, V) when is_tuple(T) -> |