diff --git a/infer/src/IR/Sil.re b/infer/src/IR/Sil.re index fbc6c18c0..fdfca4498 100644 --- a/infer/src/IR/Sil.re +++ b/infer/src/IR/Sil.re @@ -123,8 +123,7 @@ type inst = | Irearrange of zero_flag null_case_flag int PredSymb.path_pos | Itaint | Iupdate of zero_flag null_case_flag int PredSymb.path_pos - | Ireturn_from_call of int - | Ireturn_from_pointer_wrapper_call of int; + | Ireturn_from_call of int; /** structured expressions represent a value of structured type, such as an array or a struct. */ @@ -965,7 +964,6 @@ let inst_new_loc loc inst => | Itaint => inst | Iupdate zf ncf _ pos => Iupdate zf ncf loc.Location.line pos | Ireturn_from_call _ => Ireturn_from_call loc.Location.line - | Ireturn_from_pointer_wrapper_call _ => Ireturn_from_pointer_wrapper_call loc.Location.line }; @@ -996,7 +994,6 @@ let inst_to_string inst => { | Iupdate zf ncf n _ => "update:" ^ zero_flag_to_string zf ^ null_case_flag_to_string ncf ^ string_of_int n | Ireturn_from_call n => "return_from_call: " ^ string_of_int n - | Ireturn_from_pointer_wrapper_call n => "Ireturn_from_pointer_wrapper_call: " ^ string_of_int n } }; @@ -1048,8 +1045,7 @@ let inst_zero_flag = | Irearrange zf _ _ _ => zf | Itaint => None | Iupdate zf _ _ _ => zf - | Ireturn_from_call _ - | Ireturn_from_pointer_wrapper_call _ => None; + | Ireturn_from_call _ => None; /** Set the null case flag of the inst. */ @@ -1096,7 +1092,6 @@ let update_inst inst_old inst_new => { let zf' = combine_zero_flags (inst_zero_flag inst_old) zf; Iupdate zf' ncf n pos | Ireturn_from_call _ => inst_new - | Ireturn_from_pointer_wrapper_call _ => inst_new } }; diff --git a/infer/src/IR/Sil.rei b/infer/src/IR/Sil.rei index 5b0e06613..a274d331c 100644 --- a/infer/src/IR/Sil.rei +++ b/infer/src/IR/Sil.rei @@ -115,8 +115,7 @@ type inst = | Irearrange of zero_flag null_case_flag int PredSymb.path_pos | Itaint | Iupdate of zero_flag null_case_flag int PredSymb.path_pos - | Ireturn_from_call of int - | Ireturn_from_pointer_wrapper_call of int; + | Ireturn_from_call of int; let inst_abstraction: inst; diff --git a/infer/src/backend/buckets.ml b/infer/src/backend/buckets.ml index bd7a4173e..61d1d621a 100644 --- a/infer/src/backend/buckets.ml +++ b/infer/src/backend/buckets.ml @@ -117,8 +117,6 @@ let check_access access_opt de_opt = find_bucket n ncf | Some (Localise.Returned_from_call n) -> find_bucket n false - | Some (Localise.Returned_from_pointer_wrapper_call _) -> - Some Localise.BucketLevel.b2 | Some (Localise.Last_accessed (_, is_nullable)) when is_nullable -> Some Localise.BucketLevel.b1 | _ -> diff --git a/infer/src/backend/errdesc.ml b/infer/src/backend/errdesc.ml index 4fbac5fc1..9ce3c037e 100644 --- a/infer/src/backend/errdesc.ml +++ b/infer/src/backend/errdesc.ml @@ -16,13 +16,6 @@ module L = Logging module F = Format module DExp = DecompiledExp -let smart_pointers = [ - ["std"; "shared_ptr"]; - ["std"; "unique_ptr"] -] - -let pointer_wrapper_classes = smart_pointers - let vector_class = ["std"; "vector"] let is_one_of_classes class_name classes = @@ -38,9 +31,6 @@ let is_method_of_objc_cpp_class pname classes = is_one_of_classes class_name classes | _ -> false -let method_of_pointer_wrapper pname = - is_method_of_objc_cpp_class pname pointer_wrapper_classes - let is_vector_method pname = is_method_of_objc_cpp_class pname [vector_class] @@ -761,10 +751,6 @@ let explain_dexp_access prop dexp is_nullable = | Const.Cfun _ -> (* Treat function as an update *) Some (Sil.Eexp (Exp.Const c, Sil.Ireturn_from_call loc.Location.line)) | _ -> None) - | DExp.Dretcall (DExp.Dconst (Const.Cfun pname as c ) , _, loc, _ ) - when method_of_pointer_wrapper pname -> - if verbose then (L.d_strln "lookup: found Dretcall "); - Some (Sil.Eexp (Exp.Const c, Sil.Ireturn_from_pointer_wrapper_call loc.Location.line)) | DExp.Dpvaraddr pvar -> (L.d_strln ("lookup: found Dvaraddr " ^ DExp.to_string (DExp.Dpvaraddr pvar))); find_ptsto (Exp.Lvar pvar) @@ -783,8 +769,6 @@ let explain_dexp_access prop dexp is_nullable = Some (Localise.Last_accessed (n, is_nullable)) | Some (Sil.Ireturn_from_call n) -> Some (Localise.Returned_from_call n) - | Some (Sil.Ireturn_from_pointer_wrapper_call n) -> - Some (Localise.Returned_from_pointer_wrapper_call n) | Some Sil.Ialloc when !Config.curr_language = Config.Java -> Some Localise.Initialized_automatically | Some inst -> @@ -817,10 +801,6 @@ let explain_dereference_access outermost_array is_nullable _de_opt prop = | Some de -> Some (if outermost_array then remove_outermost_array_access de else de) in let value_str = match de_opt with - | Some (DExp.Darrow ((DExp.Dpvaraddr pvar), f) as de) -> - if is_special_field smart_pointers None f then - DExp.to_string (DExp.Dpvaraddr pvar) - else DExp.to_string de | Some de -> DExp.to_string de | None -> "" in diff --git a/infer/src/backend/localise.ml b/infer/src/backend/localise.ml index 0e1720833..084d29a28 100644 --- a/infer/src/backend/localise.ml +++ b/infer/src/backend/localise.ml @@ -481,7 +481,6 @@ type access = | Last_accessed of int * bool (* line, is_nullable flag *) | Initialized_automatically | Returned_from_call of int - | Returned_from_pointer_wrapper_call of int let dereference_string deref_str value_str access_opt loc = let tags = deref_str.tags in @@ -507,7 +506,6 @@ let dereference_string deref_str value_str access_opt loc = Tags.add tags Tags.assigned_line line_str; ["last assigned on line " ^ line_str] | Some (Returned_from_call _) -> [] - | Some (Returned_from_pointer_wrapper_call _) -> [] | Some Initialized_automatically -> ["initialized automatically"] in let problem_desc = diff --git a/infer/src/backend/localise.mli b/infer/src/backend/localise.mli index 092f28413..ffb376d91 100644 --- a/infer/src/backend/localise.mli +++ b/infer/src/backend/localise.mli @@ -176,7 +176,6 @@ type access = | Last_accessed of int * bool (* line, is_nullable flag *) | Initialized_automatically | Returned_from_call of int - | Returned_from_pointer_wrapper_call of int val dereference_string : deref_str -> string -> access option -> Location.t -> error_desc