From 66d9ce1d510dfc16d03d64d0a5c94f8aafdeef71 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Fri, 23 Jul 2021 02:29:29 -0700 Subject: [PATCH] [procdesc] look at capture DB only -- cost 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: D29826482 fbshipit-source-id: f8c7cb243 --- infer/src/cost/cost.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/cost/cost.ml b/infer/src/cost/cost.ml index a281bf691..86f549e95 100644 --- a/infer/src/cost/cost.ml +++ b/infer/src/cost/cost.ml @@ -444,7 +444,7 @@ let checker ({InterproceduralAnalysis.proc_desc; exe_env; analyze_dependency} as ; get_node_nb_exec ; get_summary ; get_formals - ; get_proc_desc= AnalysisCallbacks.get_proc_desc + ; get_proc_desc= Procdesc.load ; proc_resolve_attributes= Attributes.load } in AnalysisCallbacks.html_debug_new_node_session (NodeCFG.start_node node_cfg)