From ae3f1d79c9cec09242239360e459c077bc54a8aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezgi=20=C3=87i=C3=A7ek?= Date: Tue, 13 Oct 2020 09:15:48 -0700 Subject: [PATCH] [inferbo] Replace call to clone with equivalent call to id Summary: Much simpler and more explicit Reviewed By: ngorogiannis Differential Revision: D24278236 fbshipit-source-id: 9fe688197 --- infer/src/bufferoverrun/bufferOverrunModels.ml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/infer/src/bufferoverrun/bufferOverrunModels.ml b/infer/src/bufferoverrun/bufferOverrunModels.ml index abe38a1d7..d24454ce5 100644 --- a/infer/src/bufferoverrun/bufferOverrunModels.ml +++ b/infer/src/bufferoverrun/bufferOverrunModels.ml @@ -1605,15 +1605,6 @@ module Buffer = struct {exec; check= no_check} end -module Object = struct - let clone exp = - let exec {integer_type_widths} ~ret:(ret_id, _) mem = - let v = Sem.eval integer_type_widths exp mem in - model_by_value v ret_id mem - in - {exec; check= no_check} -end - module InferAnnotation = struct let assert_get index_exp coll_exp = match coll_exp with @@ -1841,7 +1832,7 @@ module Call = struct $--> StdVector.constructor_empty ; -"google" &:: "StrLen" <>$ capt_exp $--> strlen ; (* Java models *) - -"java.lang.Object" &:: "clone" <>$ capt_exp $--> Object.clone + -"java.lang.Object" &:: "clone" <>$ capt_exp $--> id ; +PatternMatch.Java.implements_arrays &:: "asList" <>$ capt_exp $!--> create_copy_array ; +PatternMatch.Java.implements_arrays &:: "copyOf" <>$ capt_exp $+ capt_exp $+...$--> copyOf ; (* model sets and maps as lists *)