diff --git a/infer/src/IR/CallFlags.ml b/infer/src/IR/CallFlags.ml index 61766f6e9..2da99c446 100644 --- a/infer/src/IR/CallFlags.ml +++ b/infer/src/IR/CallFlags.ml @@ -18,7 +18,6 @@ type t = ; cf_assign_last_arg: bool ; cf_noreturn: bool ; cf_is_objc_block: bool - ; cf_targets: Typ.Procname.t list ; cf_with_block_parameters: bool } [@@deriving compare] @@ -35,5 +34,4 @@ let default = ; cf_assign_last_arg= false ; cf_noreturn= false ; cf_is_objc_block= false - ; cf_with_block_parameters= false - ; cf_targets= [] } + ; cf_with_block_parameters= false } diff --git a/infer/src/IR/CallFlags.mli b/infer/src/IR/CallFlags.mli index 6f572c1a1..c7b65c8a8 100644 --- a/infer/src/IR/CallFlags.mli +++ b/infer/src/IR/CallFlags.mli @@ -18,7 +18,6 @@ type t = ; cf_assign_last_arg: bool ; cf_noreturn: bool ; cf_is_objc_block: bool - ; cf_targets: Typ.Procname.t list ; cf_with_block_parameters: bool } [@@deriving compare] diff --git a/infer/src/biabduction/SymExec.ml b/infer/src/biabduction/SymExec.ml index d78353efe..4b953af0e 100644 --- a/infer/src/biabduction/SymExec.ml +++ b/infer/src/biabduction/SymExec.ml @@ -603,24 +603,13 @@ let resolve_virtual_pname tenv prop actuals callee_pname call_flags : Typ.Procna | _ when not (call_flags.CallFlags.cf_virtual || call_flags.CallFlags.cf_interface) -> (* if this is not a virtual or interface call, there's no need for resolution *) [callee_pname] - | (receiver_exp, actual_receiver_typ) :: _ -> ( + | (receiver_exp, actual_receiver_typ) :: _ -> if !Language.curr_language <> Language.Java then (* default mode for Obj-C/C++/Java virtual calls: resolution only *) [do_resolve callee_pname receiver_exp actual_receiver_typ] else let resolved_target = do_resolve callee_pname receiver_exp actual_receiver_typ in - match call_flags.CallFlags.cf_targets with - | target :: _ - when call_flags.CallFlags.cf_interface - && receiver_types_equal callee_pname actual_receiver_typ - && Typ.Procname.equal resolved_target callee_pname -> - (* "production mode" of dynamic dispatch for Java: unsound, but faster. the handling - is restricted to interfaces: if we can't resolve an interface call, we pick the - first implementation of the interface and call it *) - [target] - | _ -> - (* default mode for Java virtual calls: resolution only *) - [resolved_target] ) + [resolved_target] | _ -> L.(die InternalError) "A virtual call must have a receiver"