@ -636,34 +636,32 @@ let resolve_java_pname tenv prop args pname_java call_flags : Procname.java =
if not already analyzed * )
let resolve_and_analyze
tenv caller_pdesc prop args callee_proc_name call_flags : Procname . t * Specs . summary option =
(* TODO ( # 9333890 ) : Fix conflict with method overloading by encoding in the procedure name
(* 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 : unit =
let analyze_ondemand resolved_pname : Specs . summary option =
if Procname . equal resolved_pname callee_proc_name then
Ondemand . analyze_proc_name ~ propagate_exceptions : true caller_pdesc callee_proc_name
else
(* Create the type sprecialized procedure description and analyze it directly *)
Option . iter
~ f : ( fun specialized_pdesc ->
Ondemand . analyze_proc_desc ~ propagate_exceptions : true caller_pdesc specialized_pdesc )
( match Ondemand . get_proc_desc resolved_pname with
| Some resolved_proc_desc ->
Some resolved_proc_desc
| None ->
begin
Option . map
~ f : ( fun callee_proc_desc ->
Cfg . specialize_types callee_proc_desc resolved_pname args )
( Ondemand . get_proc_desc callee_proc_name )
end ) in
let analyze specialized_pdesc =
Ondemand . analyze_proc_desc ~ propagate_exceptions : true caller_pdesc specialized_pdesc in
let resolved_proc_desc_option =
match Ondemand . get_proc_desc resolved_pname with
| Some resolved_proc_desc ->
Some resolved_proc_desc
| None ->
( Option . map
~ f : ( fun callee_proc_desc ->
Cfg . specialize_types callee_proc_desc resolved_pname args )
( Ondemand . get_proc_desc callee_proc_name ) ) in
Option . bind resolved_proc_desc_option analyze in
let resolved_pname = match callee_proc_name with
| Procname . Java callee_proc_name_java ->
Procname . Java
( resolve_java_pname tenv prop args callee_proc_name_java call_flags )
| _ ->
callee_proc_name in
analyze_ondemand resolved_pname ;
resolved_pname , Specs . get_summary resolved_pname
resolved_pname , analyze_ondemand resolved_pname
(* * recognize calls to the constructor java.net.URL and splits the argument string
@ -1087,10 +1085,9 @@ let rec sym_exec tenv current_pdesc _instr (prop_: Prop.normal Prop.t) path
let resolved_pnames =
resolve_virtual_pname tenv norm_prop url_handled_args callee_pname call_flags in
let exec_one_pname pname =
Ondemand . analyze_proc_name ~ propagate_exceptions : true current_pdesc pname ;
let exec_skip_call ret_annots ret_type = skip_call norm_prop path pname ret_annots
loc ret_id ( Some ret_type ) url_handled_args in
match Specs. get_summary pname with
match Ondemand. analyze_proc_name ~ propagate_exceptions : true current_pdesc pname with
| None ->
let ret_typ = Typ . java_proc_return_typ callee_pname_java in
let ret_annots = load_ret_annots callee_pname in
@ -1110,8 +1107,9 @@ let rec sym_exec tenv current_pdesc _instr (prop_: Prop.normal Prop.t) path
match resolve_virtual_pname tenv prop_r n_actual_params callee_pname call_flags with
| resolved_pname :: _ -> resolved_pname
| [] -> callee_pname in
Ondemand . analyze_proc_name
~ propagate_exceptions : true current_pdesc resolved_pname ;
let resolved_summary_opt =
Ondemand . analyze_proc_name
~ propagate_exceptions : true current_pdesc resolved_pname in
let callee_pdesc_opt = Ondemand . get_proc_desc resolved_pname in
let ret_typ_opt = Option . map ~ f : Procdesc . get_ret_type callee_pdesc_opt in
let sentinel_result =
@ -1120,7 +1118,6 @@ let rec sym_exec tenv current_pdesc _instr (prop_: Prop.normal Prop.t) path
( call_args prop_r callee_pname actual_params ret_id loc )
else [ ( prop_r , path ) ] in
let do_call ( prop , path ) =
let resolved_summary_opt = Specs . get_summary resolved_pname in
if Option . value_map ~ f : call_should_be_skipped ~ default : true resolved_summary_opt then
(* If it's an ObjC getter or setter, call the builtin rather than skipping *)
let attrs_opt =