[procdesc] look at capture DB only -- closuresubst

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

fbshipit-source-id: 4373825d3
master
Nikos Gorogiannis 3 years ago committed by Facebook GitHub Bot
parent 66d9ce1d51
commit e00fe73f91

@ -223,7 +223,7 @@ let process summary =
let proc_attributes = Procdesc.get_attributes pdesc in
match proc_attributes.ProcAttributes.specialized_with_blocks_info with
| Some spec_with_blocks_info -> (
match AnalysisCallbacks.get_proc_desc spec_with_blocks_info.orig_proc with
match Procdesc.load spec_with_blocks_info.orig_proc with
| Some orig_proc_desc ->
let formals_to_blocks_map = spec_with_blocks_info.formals_to_procs_and_new_formals in
Procdesc.shallow_copy_code_from_pdesc ~orig_pdesc:orig_proc_desc ~dest_pdesc:pdesc ;

Loading…
Cancel
Save