[attrs] look at capture DB only -- pulse

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: D29817582

fbshipit-source-id: 24f9dfcc3
master
Nikos Gorogiannis 3 years ago committed by Facebook GitHub Bot
parent c10ddea518
commit 41c4021162

@ -29,9 +29,7 @@ module PulseTransferFunctions = struct
type analysis_data = PulseSummary.t InterproceduralAnalysis.t type analysis_data = PulseSummary.t InterproceduralAnalysis.t
let get_pvar_formals pname = let get_pvar_formals pname = IRAttributes.load pname |> Option.map ~f:Pvar.get_pvar_formals
AnalysisCallbacks.proc_resolve_attributes pname |> Option.map ~f:Pvar.get_pvar_formals
let interprocedural_call {InterproceduralAnalysis.analyze_dependency; tenv; proc_desc} path ret let interprocedural_call {InterproceduralAnalysis.analyze_dependency; tenv; proc_desc} path ret
callee_pname call_exp actuals call_loc astate = callee_pname call_exp actuals call_loc astate =

@ -6,6 +6,7 @@
*) *)
open! IStd open! IStd
module IRAttributes = Attributes
open PulseBasicInterface open PulseBasicInterface
open PulseDomainInterface open PulseDomainInterface
open PulseOperations.Import open PulseOperations.Import
@ -96,10 +97,7 @@ module Misc = struct
List.map args ~f:(fun {ProcnameDispatcher.Call.FuncArg.arg_payload= actual; typ} -> List.map args ~f:(fun {ProcnameDispatcher.Call.FuncArg.arg_payload= actual; typ} ->
(actual, typ) ) (actual, typ) )
in in
let formals_opt = let formals_opt = IRAttributes.load callee_procname |> Option.map ~f:Pvar.get_pvar_formals in
AnalysisCallbacks.proc_resolve_attributes callee_procname
|> Option.map ~f:Pvar.get_pvar_formals
in
let<+> astate = let<+> astate =
PulseCallOperations.unknown_call tenv path location (Model skip_reason) ~ret ~actuals PulseCallOperations.unknown_call tenv path location (Model skip_reason) ~ret ~actuals
~formals_opt astate ~formals_opt astate

Loading…
Cancel
Save