From 7bbfb81706edcba07eddf98b4677f36de26ae3bf Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Tue, 10 Aug 2021 03:10:48 -0700 Subject: [PATCH] [starvation] use capture attributes instead of preanalysed ones Summary: As per title. Reviewed By: ezgicicek Differential Revision: D30192614 fbshipit-source-id: 6401876c3 --- infer/src/concurrency/starvation.ml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/infer/src/concurrency/starvation.ml b/infer/src/concurrency/starvation.ml index d62740a6b..5894791d4 100644 --- a/infer/src/concurrency/starvation.ml +++ b/infer/src/concurrency/starvation.ml @@ -831,11 +831,14 @@ let reporting {InterproceduralAnalysis.procedures; file_exe_env; analyze_file_de payload report_map in let report_procedure report_map procname = - analyze_file_dependency procname - |> Option.value_map ~default:report_map ~f:(fun (proc_desc, summary) -> - let attributes = Procdesc.get_attributes proc_desc in - let tenv = Exe_env.get_proc_tenv file_exe_env procname in - if should_report attributes then report_on_proc tenv attributes report_map summary - else report_map ) + match Attributes.load procname with + | None -> + report_map + | Some attributes -> + analyze_file_dependency procname + |> Option.value_map ~default:report_map ~f:(fun (_proc_desc, summary) -> + let tenv = Exe_env.get_proc_tenv file_exe_env procname in + if should_report attributes then report_on_proc tenv attributes report_map summary + else report_map ) in List.fold procedures ~init:ReportMap.empty ~f:report_procedure |> ReportMap.issue_log_of