Summary: We have some FPs due to unknown init methods that are added dynamically. Reviewed By: ezgicicek Differential Revision: D27856371 fbshipit-source-id: b6fb46df3
@ -357,9 +357,9 @@ module ObjC_Cpp = struct
if is_instance then ObjCInstanceMethod else ObjCClassMethod
let is_objc_constructor method_name =
String.equal method_name "new" || String.is_prefix ~prefix:"init" method_name
let is_prefix_init s = String.is_prefix ~prefix:"init" s
let is_objc_constructor method_name = String.equal method_name "new" || is_prefix_init method_name
let is_objc_kind = function
| ObjCClassMethod | ObjCInstanceMethod | ObjCInternalMethod ->
@ -605,6 +605,12 @@ let is_objc_dealloc procname =
match procname with ObjC_Cpp {method_name} -> ObjC_Cpp.is_objc_dealloc method_name | _ -> false
let is_objc_init procname =
is_objc_method procname
&&
match procname with ObjC_Cpp {method_name} -> ObjC_Cpp.is_prefix_init method_name | _ -> false
let block_of_procname procname =
match procname with
| Block block ->
@ -326,6 +326,9 @@ val is_cpp_lambda : t -> bool
val is_objc_dealloc : t -> bool
(** Return whether the dealloc method of an Objective-C class. *)
val is_objc_init : t -> bool
(** Return whether the init method of an Objective-C class. *)
val is_c_method : t -> bool
(** Return true this is an Objective-C/C++ method name. *)
@ -447,6 +447,9 @@ module Dom = struct
join_unchecked_callees
(UncheckedCallees.replace_location_by_call location callee_summary)
(UncheckedCalleesCond.replace_location_by_call location callee_summary_cond)
| None when Procname.is_objc_init callee ->
(* If callee is unknown ObjC initializer, ignore it. *)
astate
| _ ->
(* Otherwise, add callee's name. *)