@ -587,36 +587,39 @@ type resolve_and_analyze_result =
analyzed * )
let resolve_and_analyze
{ InterproceduralAnalysis . analyze_dependency ; analyze_pdesc_dependency ; proc_desc ; tenv }
? ( has_clang_model = false ) prop args callee_proc_name call_flags : resolve_and_analyze_result =
(* TODO ( #15748878 ) : Fix conflict with method overloading by encoding in the procedure name
whether the method is defined or generated by the specialization * )
let analyze_ondemand resolved_pname =
if Procname . equal resolved_pname callee_proc_name then
( AnalysisCallbacks . get_proc_desc callee_proc_name , analyze_dependency callee_proc_name )
else
(* Create the type specialized procedure description and analyze it directly *)
let resolved_proc_desc_option =
match AnalysisCallbacks . get_proc_desc resolved_pname with
| Some _ as resolved_proc_desc ->
resolved_proc_desc
| None ->
let procdesc_opt = AnalysisCallbacks . get_proc_desc callee_proc_name in
Option . map procdesc_opt ~ f : ( fun callee_proc_desc ->
(* It is possible that the types of the arguments are not as precise as the type of
the objects in the heap , so we should update them to get the best results . * )
let resolved_args = resolve_args prop args in
SpecializeProcdesc . with_formals_types ~ has_clang_model callee_proc_desc
resolved_pname resolved_args )
in
( resolved_proc_desc_option
, Option . bind resolved_proc_desc_option ~ f : ( fun pdesc ->
analyze_pdesc_dependency pdesc | > Option . map ~ f : ( fun summary -> ( pdesc , summary ) ) ) )
in
let resolved_pname =
resolve_pname ~ caller_pdesc : proc_desc tenv prop args callee_proc_name call_flags
in
let resolved_procdesc_opt , resolved_summary_opt = analyze_ondemand resolved_pname in
{ resolved_pname ; resolved_procdesc_opt ; resolved_summary_opt }
~ has_clang_model prop args callee_proc_name call_flags : resolve_and_analyze_result =
if has_clang_model then
{ resolved_pname = callee_proc_name ; resolved_procdesc_opt = None ; resolved_summary_opt = None }
else
(* TODO ( #15748878 ) : Fix conflict with method overloading by encoding in the procedure name
whether the method is defined or generated by the specialization * )
let analyze_ondemand resolved_pname =
if Procname . equal resolved_pname callee_proc_name then
( AnalysisCallbacks . get_proc_desc callee_proc_name , analyze_dependency callee_proc_name )
else
(* Create the type specialized procedure description and analyze it directly *)
let resolved_proc_desc_option =
match AnalysisCallbacks . get_proc_desc resolved_pname with
| Some _ as resolved_proc_desc ->
resolved_proc_desc
| None ->
let procdesc_opt = AnalysisCallbacks . get_proc_desc callee_proc_name in
Option . map procdesc_opt ~ f : ( fun callee_proc_desc ->
(* It is possible that the types of the arguments are not as precise as the type of
the objects in the heap , so we should update them to get the best results . * )
let resolved_args = resolve_args prop args in
SpecializeProcdesc . with_formals_types callee_proc_desc resolved_pname
resolved_args )
in
( resolved_proc_desc_option
, Option . bind resolved_proc_desc_option ~ f : ( fun pdesc ->
analyze_pdesc_dependency pdesc | > Option . map ~ f : ( fun summary -> ( pdesc , summary ) ) ) )
in
let resolved_pname =
resolve_pname ~ caller_pdesc : proc_desc tenv prop args callee_proc_name call_flags
in
let resolved_procdesc_opt , resolved_summary_opt = analyze_ondemand resolved_pname in
{ resolved_pname ; resolved_procdesc_opt ; resolved_summary_opt }
(* * recognize calls to the constructor java.net.URL and splits the argument string to be only the
@ -1158,7 +1161,8 @@ let rec sym_exec
norm_args
in
let resolve_and_analyze_result =
resolve_and_analyze analysis_data norm_prop norm_args callee_pname call_flags
resolve_and_analyze ~ has_clang_model : false analysis_data norm_prop norm_args
callee_pname call_flags
in
let resolved_pname = resolve_and_analyze_result . resolved_pname in
match resolve_and_analyze_result . resolved_summary_opt with