From e2a75f2b46cb33f756c6b84e96563da31660cd96 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Wed, 1 Nov 2017 19:19:32 -0700 Subject: [PATCH] [hil] always run liveness analysis before HIL lowering Reviewed By: jeremydubreil Differential Revision: D6216276 fbshipit-source-id: 855d6d6 --- infer/src/absint/LowerHil.ml | 3 ++- infer/src/concurrency/RacerD.ml | 1 - infer/src/quandary/TaintAnalysis.ml | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/infer/src/absint/LowerHil.ml b/infer/src/absint/LowerHil.ml index 7a21854b2..d688ea04e 100644 --- a/infer/src/absint/LowerHil.ml +++ b/infer/src/absint/LowerHil.ml @@ -95,7 +95,8 @@ struct module Interpreter = AbstractInterpreter.Make (CFG) (Make (MakeTransferFunctions) (DefaultConfig)) - let compute_post proc_data ~initial = + let compute_post ({ProcData.pdesc; tenv} as proc_data) ~initial = + if not (Procdesc.did_preanalysis pdesc) then Preanal.do_liveness pdesc tenv ; let initial' = (initial, IdAccessPathMapDomain.empty) in Option.map ~f:fst (Interpreter.compute_post ~debug:false proc_data ~initial:initial') diff --git a/infer/src/concurrency/RacerD.ml b/infer/src/concurrency/RacerD.ml index 9578d51f3..4c32eb89f 100644 --- a/infer/src/concurrency/RacerD.ml +++ b/infer/src/concurrency/RacerD.ml @@ -921,7 +921,6 @@ let analyze_procedure {Callbacks.proc_desc; get_proc_desc; tenv; summary} = in let open RacerDDomain in if should_analyze_proc proc_desc tenv then ( - if not (Procdesc.did_preanalysis proc_desc) then Preanal.do_liveness proc_desc tenv ; let formal_map = FormalMap.make proc_desc in let proc_data = ProcData.make proc_desc tenv get_proc_desc in let initial = diff --git a/infer/src/quandary/TaintAnalysis.ml b/infer/src/quandary/TaintAnalysis.ml index bc85c7106..748b54d69 100644 --- a/infer/src/quandary/TaintAnalysis.ml +++ b/infer/src/quandary/TaintAnalysis.ml @@ -847,9 +847,7 @@ module Make (TaintSpecification : TaintSpec.S) = struct in (access_tree, IdAccessPathMapDomain.empty) in - if not (Procdesc.did_preanalysis proc_desc) then ( - Preanal.do_liveness proc_desc tenv ; - Preanal.do_dynamic_dispatch proc_desc (Cg.create (SourceFile.invalid __FILE__)) tenv ) ; + Preanal.do_dynamic_dispatch proc_desc (Cg.create (SourceFile.invalid __FILE__)) tenv ; let initial = make_initial proc_desc in let extras = let formal_map = FormalMap.make proc_desc in