From 1afd05a689fe94f2e9128eba3dedb6b8e180675f Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Fri, 23 Jul 2021 02:29:07 -0700 Subject: [PATCH] [attrs] look at capture DB only -- uninit.ml Summary: `AnalysisCallbacks.proc_resolve_attributes` introduces non-determinism because it first looks for the attributes in a (procdesc in a) summary and if it doesn't find it then returns the value in the attribute column from the capture DB. The problem is: - the main factor affecting the existence of a summary on-disk is timing; - the two proc descs are generally different, as the one in the summary is preanalysed and the one in the capture DB is not; - this extends to the attributes included in the proc desc in some cases. The plan is to eliminate these calls one by one, replacing with `Attributes.load` which only looks at the capture DB attribute column. Reviewed By: skcho Differential Revision: D29816411 fbshipit-source-id: d06c4bd48 --- infer/src/checkers/uninit.ml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infer/src/checkers/uninit.ml b/infer/src/checkers/uninit.ml index cdd367eb6..2a049b0e4 100644 --- a/infer/src/checkers/uninit.ml +++ b/infer/src/checkers/uninit.ml @@ -85,9 +85,7 @@ module TransferFunctions (CFG : ProcCfg.S) = struct let is_array t = match t.Typ.desc with Typ.Tarray _ -> true | _ -> false - let get_formals pname = - AnalysisCallbacks.proc_resolve_attributes pname |> Option.map ~f:ProcAttributes.get_formals - + let get_formals pname = Attributes.load pname |> Option.map ~f:ProcAttributes.get_formals let should_report_var pdesc tenv maybe_uninit_vars access_expr = let base = HilExp.AccessExpression.get_base access_expr in