|
|
@ -623,31 +623,33 @@ let make_results_table exe_env summaries =
|
|
|
|
aggregate_post tenv procname acc summary )
|
|
|
|
aggregate_post tenv procname acc summary )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let should_report_on_proc file_exe_env procdesc =
|
|
|
|
let should_report_on_proc file_exe_env proc_name =
|
|
|
|
let proc_name = Procdesc.get_proc_name procdesc in
|
|
|
|
Attributes.load proc_name
|
|
|
|
let tenv = Exe_env.get_proc_tenv file_exe_env proc_name in
|
|
|
|
|> Option.exists ~f:(fun attrs ->
|
|
|
|
match proc_name with
|
|
|
|
let tenv = Exe_env.get_proc_tenv file_exe_env proc_name in
|
|
|
|
| CSharp _ ->
|
|
|
|
let is_not_private = not ProcAttributes.(equal_access (get_access attrs) Private) in
|
|
|
|
not (ProcAttributes.equal_access (Procdesc.get_access procdesc) Private)
|
|
|
|
match (proc_name : Procname.t) with
|
|
|
|
| Java java_pname ->
|
|
|
|
| CSharp _ ->
|
|
|
|
(* return true if procedure is at an abstraction boundary or reporting has been explicitly
|
|
|
|
is_not_private
|
|
|
|
requested via @ThreadSafe in java *)
|
|
|
|
| Java java_pname ->
|
|
|
|
RacerDModels.is_thread_safe_method proc_name tenv
|
|
|
|
(* return true if procedure is at an abstraction boundary or reporting has been explicitly
|
|
|
|
|| (not (ProcAttributes.equal_access (Procdesc.get_access procdesc) Private))
|
|
|
|
requested via @ThreadSafe in java *)
|
|
|
|
&& (not (Procname.Java.is_class_initializer java_pname))
|
|
|
|
RacerDModels.is_thread_safe_method proc_name tenv
|
|
|
|
&& (not (Procname.Java.is_autogen_method java_pname))
|
|
|
|
|| is_not_private
|
|
|
|
&& not (Annotations.pdesc_return_annot_ends_with procdesc Annotations.visibleForTesting)
|
|
|
|
&& (not (Procname.Java.is_class_initializer java_pname))
|
|
|
|
| ObjC_Cpp _ when Procname.is_cpp_lambda proc_name ->
|
|
|
|
&& (not (Procname.Java.is_autogen_method java_pname))
|
|
|
|
(* do not report on lambdas; they are essentially private though do not appear as such *)
|
|
|
|
&& not Annotations.(attrs_return_annot_ends_with attrs visibleForTesting)
|
|
|
|
false
|
|
|
|
| ObjC_Cpp _ when Procname.is_cpp_lambda proc_name ->
|
|
|
|
| ObjC_Cpp {kind= CPPMethod _ | CPPConstructor _ | CPPDestructor _} ->
|
|
|
|
(* do not report on lambdas; they are essentially private though do not appear as such *)
|
|
|
|
not (ProcAttributes.equal_access (Procdesc.get_access procdesc) Private)
|
|
|
|
false
|
|
|
|
| ObjC_Cpp {kind= ObjCClassMethod | ObjCInstanceMethod | ObjCInternalMethod; class_name} ->
|
|
|
|
| ObjC_Cpp {kind= CPPMethod _ | CPPConstructor _ | CPPDestructor _} ->
|
|
|
|
Tenv.lookup tenv class_name
|
|
|
|
is_not_private
|
|
|
|
|> Option.exists ~f:(fun {Struct.exported_objc_methods} ->
|
|
|
|
| ObjC_Cpp {kind= ObjCClassMethod | ObjCInstanceMethod | ObjCInternalMethod; class_name} ->
|
|
|
|
List.mem ~equal:Procname.equal exported_objc_methods proc_name )
|
|
|
|
Tenv.lookup tenv class_name
|
|
|
|
| _ ->
|
|
|
|
|> Option.exists ~f:(fun {Struct.exported_objc_methods} ->
|
|
|
|
false
|
|
|
|
List.mem ~equal:Procname.equal exported_objc_methods proc_name )
|
|
|
|
|
|
|
|
| _ ->
|
|
|
|
|
|
|
|
false )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let class_has_concurrent_method class_summaries =
|
|
|
|
let class_has_concurrent_method class_summaries =
|
|
|
@ -675,7 +677,7 @@ let aggregate_by_class {InterproceduralAnalysis.procedures; file_exe_env; analyz
|
|
|
|
Procname.get_class_type_name procname
|
|
|
|
Procname.get_class_type_name procname
|
|
|
|
|> Option.bind ~f:(fun classname ->
|
|
|
|
|> Option.bind ~f:(fun classname ->
|
|
|
|
analyze_file_dependency procname
|
|
|
|
analyze_file_dependency procname
|
|
|
|
|> Option.filter ~f:(fun (pdesc, _) -> should_report_on_proc file_exe_env pdesc)
|
|
|
|
|> Option.filter ~f:(fun _ -> should_report_on_proc file_exe_env procname)
|
|
|
|
|> Option.map ~f:(fun summary_proc_desc ->
|
|
|
|
|> Option.map ~f:(fun summary_proc_desc ->
|
|
|
|
Typ.Name.Map.update classname
|
|
|
|
Typ.Name.Map.update classname
|
|
|
|
(function
|
|
|
|
(function
|
|
|
|