From 6b6f6be6d96346c0e2b4cf17295b931fa1bb8674 Mon Sep 17 00:00:00 2001 From: Dino Distefano Date: Tue, 24 Apr 2018 08:21:30 -0700 Subject: [PATCH] Don't check prune node condition in the control dependecy analysis for java code Reviewed By: ezgicicek Differential Revision: D7743520 fbshipit-source-id: aa09eaa --- infer/src/checkers/control.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/infer/src/checkers/control.ml b/infer/src/checkers/control.ml index 1341937ec..3f0e621b0 100644 --- a/infer/src/checkers/control.ml +++ b/infer/src/checkers/control.ml @@ -93,11 +93,17 @@ module TransferFunctionsControlDeps (CFG : ProcCfg.S) = struct let astate' = Exp.free_vars exp |> Sequence.map ~f:Var.of_id |> Sequence.to_list |> ControlDepSet.of_list - |> if true_branch && Sil.is_loop if_kind then Domain.union astate else Domain.diff astate + |> + if (true_branch && Sil.is_loop if_kind) || Language.curr_language_is Java then + Domain.union astate + else Domain.diff astate in Exp.program_vars exp |> Sequence.map ~f:Var.of_pvar |> Sequence.to_list |> ControlDepSet.of_list - |> if true_branch && Sil.is_loop if_kind then Domain.union astate' else Domain.diff astate' + |> + if (true_branch && Sil.is_loop if_kind) || Language.curr_language_is Java then + Domain.union astate' + else Domain.diff astate' | Sil.Load _ | Sil.Store _ | Sil.Call _