From 89ba2cc163be8e67796033a06b32a5a2ef9f755f Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Fri, 23 Jul 2021 02:29:38 -0700 Subject: [PATCH] [procdesc] look at capture DB only -- pulse Summary: `AnalysisCallbacks.get_proc_desc` potentially introduces non-determinism because it first looks for the `proc_desc` in the capture DB and if absent it tries to retrieve it from a summary. The problem is the two proc descs are generally different, as the one in the summary is preanalysed and the one in the capture DB is not. Unless the caller specifically needs a preanalysed `procdesc`, calls to `AnalysisCallbacks.get_proc_desc` should be replaced with `Procdesc.load`. Reviewed By: skcho Differential Revision: D29827647 fbshipit-source-id: 8b1dc289c --- infer/src/pulse/PulseCallOperations.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/pulse/PulseCallOperations.ml b/infer/src/pulse/PulseCallOperations.ml index 8420eaabf..e703071ba 100644 --- a/infer/src/pulse/PulseCallOperations.ml +++ b/infer/src/pulse/PulseCallOperations.ml @@ -306,7 +306,7 @@ let call tenv path ~caller_proc_desc ~(callee_data : (Procdesc.t * PulseSummary. |> unknown_call tenv path call_loc (SkippedKnownCall callee_pname) ~ret ~actuals ~formals_opt in - let callee_procdesc_opt = AnalysisCallbacks.get_proc_desc callee_pname in + let callee_procdesc_opt = Procdesc.load callee_pname in Option.value_map callee_procdesc_opt ~default:[Ok (ContinueProgram astate_unknown)] ~f:(unknown_objc_nil_messaging astate_unknown)