From 5aeb1697b3f7a90ab2ab71b63842fc3ed1f14ef6 Mon Sep 17 00:00:00 2001 From: Benno Stein Date: Mon, 27 Feb 2023 09:22:01 -0800 Subject: [PATCH] [incr] Add dependency tracking in Attributes.load Summary: Some analyzers and checkers directly access the `Attributes` of other procedures using `Attributes.load`. This induces a dependency which can be missed by existing dependency tracking infrastructure, but is recorded by these changes. Reviewed By: ngorogiannis Differential Revision: D43570917 fbshipit-source-id: 09c9091da80722f7e199ab2517bf32e4b21a7517 --- infer/src/IR/Attributes.ml | 1 + infer/src/backend/ondemand.ml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/infer/src/IR/Attributes.ml b/infer/src/IR/Attributes.ml index cd4d310c6ac..a55f618b2ee 100644 --- a/infer/src/IR/Attributes.ml +++ b/infer/src/IR/Attributes.ml @@ -39,6 +39,7 @@ let load_from_uid, load, clear_cache, store = result in let load pname = + Dependencies.record_pname_dep pname ; match Procname.Hash.find_opt cache pname with | Some _ as result -> result diff --git a/infer/src/backend/ondemand.ml b/infer/src/backend/ondemand.ml index 9e6c11537d2..5d8c5cc0433 100644 --- a/infer/src/backend/ondemand.ml +++ b/infer/src/backend/ondemand.ml @@ -149,10 +149,10 @@ let run_proc_analysis exe_env ?caller_pname callee_pdesc = incr nesting ; let source_file = callee_attributes.ProcAttributes.translation_unit in update_taskbar (Some callee_pname) (Some source_file) ; + let initial_callee_summary = Summary.OnDisk.reset callee_pname in Preanal.do_preanalysis exe_env callee_pdesc ; if Config.debug_mode then DotCfg.emit_proc_desc callee_attributes.translation_unit callee_pdesc |> ignore ; - let initial_callee_summary = Summary.OnDisk.reset callee_pname in add_active callee_pname ; initial_callee_summary in