[cleanup] remove unused param from supertype_find_map_opt

Reviewed By: jeremydubreil

Differential Revision: D5508593

fbshipit-source-id: 1914d1e
master
Sam Blackshear 8 years ago committed by Facebook Github Bot
parent f658690846
commit c2acc670ef

@ -36,15 +36,15 @@ let rec supertype_exists tenv pred name =
-> false
let rec supertype_find_map_opt tenv f name =
match Tenv.lookup tenv name with
| Some ({supers} as struct_typ) -> (
match f name struct_typ with
| None
match f name with
| None -> (
match Tenv.lookup tenv name with
| Some {supers}
-> List.find_map ~f:(supertype_find_map_opt tenv f) supers
| result
-> result )
| None
-> None
| None
-> None )
| result
-> result
let is_immediate_subtype tenv this_type_name super_type_name =
match Tenv.lookup tenv this_type_name with

@ -51,8 +51,7 @@ val is_subtype_of_str : Tenv.t -> Typ.Name.t -> string -> bool
val supertype_exists : Tenv.t -> (Typ.Name.t -> Typ.Struct.t -> bool) -> Typ.Name.t -> bool
(** Holds iff the predicate holds on a supertype of the named type, including the type itself *)
val supertype_find_map_opt :
Tenv.t -> (Typ.Name.t -> Typ.Struct.t -> 'a option) -> Typ.Name.t -> 'a option
val supertype_find_map_opt : Tenv.t -> (Typ.Name.t -> 'a option) -> Typ.Name.t -> 'a option
(** Return the first non-None result found when applying the given function to supertypes of the
named type, including the type itself *)

@ -138,7 +138,7 @@ module TransferFunctions (CFG : ProcCfg.S) = struct
match pn with
| Typ.Procname.Java java_pname
-> let typename = Typ.Name.Java.from_string (Typ.Procname.java_get_class_name java_pname) in
let get_container_access_ typename _ =
let get_container_access_ typename =
match (Typ.Name.name typename, Typ.Procname.java_get_method java_pname) with
| ( ("android.util.SparseArray" | "android.support.v4.util.SparseArrayCompat")
, ( "append" | "clear" | "delete" | "put" | "remove" | "removeAt" | "removeAtRange"

@ -55,7 +55,7 @@ module SourceKind = struct
| "com.facebook.infer.builtins.InferTaint", "inferSecretSource"
-> Some (Other, return)
| class_name, method_name
-> let taint_matching_supertype typename _ =
-> let taint_matching_supertype typename =
match (Typ.Name.name typename, method_name) with
| "android.app.Activity", "getIntent"
-> Some (Intent, return)
@ -113,7 +113,7 @@ module SourceKind = struct
| "codetoanalyze.java.quandary.TaintedFormals", "taintedContextBad"
-> taint_formals_with_types ["java.lang.Integer"; "java.lang.String"] Other formals
| class_name, method_name
-> let taint_matching_supertype typename _ =
-> let taint_matching_supertype typename =
match (Typ.Name.name typename, method_name) with
| "android.app.Activity", ("onActivityResult" | "onNewIntent")
-> Some (taint_formals_with_types ["android.content.Intent"] Intent formals)
@ -234,7 +234,7 @@ module SinkKind = struct
| "com.facebook.infer.builtins.InferTaint", "inferSensitiveSink"
-> taint_nth 0 Other
| class_name, method_name
-> let taint_matching_supertype typename _ =
-> let taint_matching_supertype typename =
match (Typ.Name.name typename, method_name) with
| "android.app.Activity", ("startActivityFromChild" | "startActivityFromFragment")
-> taint_nth 1 StartComponent

Loading…
Cancel
Save