diff --git a/infer/src/IR/Procname.ml b/infer/src/IR/Procname.ml index 074b9dea9..2e21fd6c8 100644 --- a/infer/src/IR/Procname.ml +++ b/infer/src/IR/Procname.ml @@ -439,6 +439,12 @@ let is_objc_method procname = match procname with ObjC_Cpp name -> ObjC_Cpp.is_objc_method name | _ -> false +let is_objc_dealloc procname = + is_objc_method procname + && + match procname with ObjC_Cpp {method_name} -> ObjC_Cpp.is_objc_dealloc method_name | _ -> false + + let block_name_of_procname procname = match procname with | Block block -> diff --git a/infer/src/IR/Procname.mli b/infer/src/IR/Procname.mli index 7c76c8ded..8e7f473a5 100644 --- a/infer/src/IR/Procname.mli +++ b/infer/src/IR/Procname.mli @@ -278,6 +278,9 @@ val get_method : t -> string val is_objc_block : t -> bool (** Return whether the procname is a block procname. *) +val is_objc_dealloc : t -> bool +(** Return whether the dealloc method of an Objective-C class. *) + val is_c_method : t -> bool (** Return true this is an Objective-C/C++ method name. *) diff --git a/infer/src/clang/CAddImplicitDeallocImpl.ml b/infer/src/clang/CAddImplicitDeallocImpl.ml new file mode 100644 index 000000000..b64b6630e --- /dev/null +++ b/infer/src/clang/CAddImplicitDeallocImpl.ml @@ -0,0 +1,81 @@ +(* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +open! IStd + +let get_dealloc_call_field (self_var, self_typ) location instrs (fieldname, field_typ, _) = + match field_typ.Typ.desc with + | Typ.Tptr (({desc= Tstruct name} as cls), Pk_pointer) when Typ.is_objc_class cls -> + let field_class_dealloc_name = Procname.make_objc_dealloc name in + let id_pvar = Ident.create_fresh Ident.knormal in + let load_pvar_instr = + Sil.Load {id= id_pvar; e= Lvar self_var; root_typ= self_typ; typ= self_typ; loc= location} + in + let id_field = Ident.create_fresh Ident.knormal in + let class_typ = match self_typ.Typ.desc with Typ.Tptr (t, _) -> t | _ -> self_typ in + let e = Exp.Lfield (Var id_pvar, fieldname, class_typ) in + let load_field_instr = + Sil.Load {id= id_field; e; root_typ= field_typ; typ= field_typ; loc= location} + in + let ret_id = Ident.create_fresh Ident.knormal in + let call_instr = + Sil.Call + ( (ret_id, Typ.void) + , Const (Cfun field_class_dealloc_name) + , [(Var id_field, field_typ)] + , location + , CallFlags.default ) + in + instrs @ [load_pvar_instr; load_field_instr; call_instr] + | _ -> + instrs + + +let process_dealloc proc_desc fields self = + let exit_node = Procdesc.get_exit_node proc_desc in + let location = Procdesc.Node.get_last_loc exit_node in + let fields_dealloc_call_instrs = + List.fold ~f:(get_dealloc_call_field self location) ~init:[] fields + in + let exit_pred_nodes = Procdesc.Node.get_preds exit_node in + let node_name = Procdesc.Node.Call CFrontend_config.dealloc in + let node_kind = Procdesc.Node.Stmt_node node_name in + let dealloc_calls_node = + Procdesc.create_node proc_desc location node_kind fields_dealloc_call_instrs + in + Procdesc.node_set_succs proc_desc dealloc_calls_node ~normal:[exit_node] ~exn:[] ; + List.iter + ~f:(fun node -> Procdesc.node_set_succs proc_desc node ~normal:[dealloc_calls_node] ~exn:[]) + exit_pred_nodes + + +let process_procdesc tenv proc_name proc_desc = + let get_struct_procname tenv proc_name = + match Procname.get_class_type_name proc_name with + | Some name -> + Tenv.lookup tenv name + | None -> + None + in + if Procdesc.is_defined proc_desc && Procname.is_objc_dealloc proc_name then + let struct_opt = get_struct_procname tenv proc_name in + match struct_opt with + | Some {fields} -> ( + let formals = Procdesc.get_formals proc_desc in + let self = List.find ~f:(fun (var, _) -> Mangled.equal var Mangled.self) formals in + match self with + | Some (self, typ) -> + let self_var = Pvar.mk self proc_name in + process_dealloc proc_desc fields (self_var, typ) + | None -> + () ) + | _ -> + () + else () + + +let process cfg tenv = Procname.Hash.iter (process_procdesc tenv) cfg diff --git a/infer/src/clang/CAddImplicitDeallocImpl.mli b/infer/src/clang/CAddImplicitDeallocImpl.mli new file mode 100644 index 000000000..8099c2bc7 --- /dev/null +++ b/infer/src/clang/CAddImplicitDeallocImpl.mli @@ -0,0 +1,18 @@ +(* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +open! IStd + +val process : Cfg.t -> Tenv.t -> unit +(** This models ARC implementation of dealloc, see + https://clang.llvm.org/docs/AutomaticReferenceCounting.html#dealloc. Dealloc methods can be + added to ObjC classes to free C memory for example, but the deallocation of the ObjC instance + variables of the object is done automatically. So here we add this explicitely to Infer: we add + calls to dealloc of the ObjC instance variables. Here we assume that every ObjC class has + already a dealloc method, because if it doesn't exist we add an empty method in + CFrontend_decl.create_and_process_dealloc_objc_impl TODO(T68411500): add calls to dealloc of the + superclass. *) diff --git a/infer/src/clang/ast_expressions.mli b/infer/src/clang/ast_expressions.mli index b508d85c0..4c0b68db8 100644 --- a/infer/src/clang/ast_expressions.mli +++ b/infer/src/clang/ast_expressions.mli @@ -14,6 +14,8 @@ val create_pointer_qual_type : ?quals:Typ.type_quals -> qual_type -> qual_type val create_reference_qual_type : ?quals:Typ.type_quals -> qual_type -> qual_type +val create_void_type : qual_type + val create_char_star_type : ?quals:Typ.type_quals -> unit -> qual_type val make_next_object_exp : diff --git a/infer/src/clang/cFrontend.ml b/infer/src/clang/cFrontend.ml index 027f718e9..753476160 100644 --- a/infer/src/clang/cFrontend.ml +++ b/infer/src/clang/cFrontend.ml @@ -50,6 +50,7 @@ let do_source_file (translation_unit_context : CFrontend_config.translation_unit L.(debug Capture Verbose) "@\n Start building call/cfg graph for '%a'....@\n" SourceFile.pp source_file ; let cfg = compute_icfg translation_unit_context tenv ast in + CAddImplicitDeallocImpl.process cfg tenv ; L.(debug Capture Verbose) "@\n End building call/cfg graph for '%a'.@\n" SourceFile.pp source_file ; NullabilityPreanalysis.analysis cfg tenv ; SourceFiles.add source_file cfg (Tenv.FileLocal tenv) (Some integer_type_widths) ; diff --git a/infer/src/clang/cFrontend_config.ml b/infer/src/clang/cFrontend_config.ml index 71e9d83fb..1dbb21429 100644 --- a/infer/src/clang/cFrontend_config.ml +++ b/infer/src/clang/cFrontend_config.ml @@ -22,6 +22,8 @@ type decl_trans_context = [`DeclTraversal | `Translation] let alloc = "alloc" +let dealloc = "dealloc" + let assert_fail = "__assert_fail" let assert_rtn = "__assert_rtn" diff --git a/infer/src/clang/cFrontend_config.mli b/infer/src/clang/cFrontend_config.mli index fab7dfc2f..12b50a26b 100644 --- a/infer/src/clang/cFrontend_config.mli +++ b/infer/src/clang/cFrontend_config.mli @@ -22,6 +22,8 @@ type decl_trans_context = [`DeclTraversal | `Translation] val alloc : string +val dealloc : string + val assert_fail : string val assert_rtn : string diff --git a/infer/src/clang/cFrontend_decl.ml b/infer/src/clang/cFrontend_decl.ml index 06875f710..a62dcead9 100644 --- a/infer/src/clang/cFrontend_decl.ml +++ b/infer/src/clang/cFrontend_decl.ml @@ -239,6 +239,56 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron List.iter ~f:(process_one_method_decl trans_unit_ctx tenv cfg curr_class) decl_list + (* Here we add an empty dealloc method to every ObjC class if it doesn't have one. Then the implicit + implementation of such method will be added in CAddImplicitDeallocImpl.process *) + let create_and_process_dealloc_objc_impl trans_unit_ctx tenv cfg curr_class objc_class_decl_info + decl_list = + let open Clang_ast_t in + let found_dealloc = + List.exists + ~f:(fun decl -> + match decl with + | ObjCMethodDecl (_, name_info, mdi) -> + String.equal name_info.ni_name "dealloc" && mdi.Clang_ast_t.omdi_is_instance_method + | _ -> + false ) + decl_list + in + if not found_dealloc then + let name_info = + {ni_name= CFrontend_config.dealloc; ni_qual_name= [CFrontend_config.dealloc]} + in + let decl_info = + { di_pointer= CAst_utils.get_fresh_pointer () + ; di_parent_pointer= Some objc_class_decl_info.Clang_ast_t.di_pointer + ; di_source_range= objc_class_decl_info.Clang_ast_t.di_source_range + ; di_owning_module= objc_class_decl_info.Clang_ast_t.di_owning_module + ; di_is_hidden= true + ; di_is_implicit= true + ; di_is_used= true + ; di_is_this_declaration_referenced= false + ; di_is_invalid_decl= false + ; di_attributes= [] + ; di_full_comment= None + ; di_access= `None } + in + let obj_c_method_decl_info = + { omdi_is_instance_method= true + ; omdi_result_type= Ast_expressions.create_void_type + ; omdi_is_property_accessor= false + ; omdi_property_decl= None + ; omdi_parameters= [] + ; omdi_implicit_parameters= [] + ; omdi_is_variadic= false + ; omdi_is_overriding= true + ; omdi_is_optional= false + ; omdi_body= Some (Clang_ast_t.CompoundStmt (CAst_utils.dummy_stmt_info (), [])) + ; omdi_mangled_name= CFrontend_config.dealloc } + in + let method_decl = ObjCMethodDecl (decl_info, name_info, obj_c_method_decl_info) in + process_method_decl trans_unit_ctx tenv cfg curr_class method_decl + + (** Given REVERSED list of method qualifiers (method_name::class_name::rest_quals), return whether method should be translated based on method and class whitelists *) let is_whitelisted_cpp_method = @@ -332,13 +382,15 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron (ObjcCategory_decl.category_impl_decl CType_decl.qual_type_to_sil_type CType_decl.CProcname.from_decl tenv dec) ; process_methods trans_unit_ctx tenv cfg curr_class decl_list - | ObjCImplementationDecl (_, _, decl_list, _, _) -> + | ObjCImplementationDecl (objc_class_decl_info, _, decl_list, _, _) -> let curr_class = CContext.ContextClsDeclPtr dec_ptr in let qual_type_to_sil_type = CType_decl.qual_type_to_sil_type in ignore (ObjcInterface_decl.interface_impl_declaration qual_type_to_sil_type CType_decl.CProcname.from_decl tenv dec) ; - process_methods trans_unit_ctx tenv cfg curr_class decl_list + process_methods trans_unit_ctx tenv cfg curr_class decl_list ; + create_and_process_dealloc_objc_impl trans_unit_ctx tenv cfg curr_class + objc_class_decl_info decl_list | CXXMethodDecl (decl_info, _, _, _, _) | CXXConstructorDecl (decl_info, _, _, _, _) | CXXConversionDecl (decl_info, _, _, _, _) diff --git a/infer/tests/codetoanalyze/objc/biabduction/issues.exp b/infer/tests/codetoanalyze/objc/biabduction/issues.exp index c07e577f4..b93e5b1e9 100644 --- a/infer/tests/codetoanalyze/objc/biabduction/issues.exp +++ b/infer/tests/codetoanalyze/objc/biabduction/issues.exp @@ -20,7 +20,7 @@ codetoanalyze/objc/shared/block/BlockVar.m, BlockVar.blockPostBad, 5, NULL_DEREF codetoanalyze/objc/shared/block/BlockVar.m, BlockVar.capturedNullDeref, 5, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure capturedNullDeref,start of procedure block] codetoanalyze/objc/shared/block/BlockVar.m, BlockVar.navigateToURLInBackground, 8, NULL_DEREFERENCE, B1, ERROR, [start of procedure navigateToURLInBackground,start of procedure block,start of procedure test,return from a call to BlockVar.test,return from a call to objc_blockBlockVar.navigateToURLInBackground_1,Taking true branch] codetoanalyze/objc/shared/block/block.m, main1, 30, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure main1(),start of procedure block,start of procedure block,return from a call to objc_blockobjc_blockmain1_2_3,return from a call to objc_blockmain1_2,start of procedure block,return from a call to objc_blockmain1_1] -codetoanalyze/objc/shared/block/block_no_args.m, My_manager.m, 10, NULL_DEREFERENCE, B1, ERROR, [start of procedure m,start of procedure block,return from a call to objc_blockMy_manager.m_1,Taking true branch] +codetoanalyze/objc/shared/block/block_no_args.m, Block_no_args.m, 10, NULL_DEREFERENCE, B1, ERROR, [start of procedure m,start of procedure block,return from a call to objc_blockBlock_no_args.m_1,Taking true branch] codetoanalyze/objc/shared/category_procdesc/main.c, CategoryProcdescMain, 3, MEMORY_LEAK, no_bucket, ERROR, [start of procedure CategoryProcdescMain(),Skipping performDaysWork: method has no implementation] codetoanalyze/objc/shared/field_superclass/SuperExample.m, ASuper.init, 2, NULL_DEREFERENCE, B2, ERROR, [start of procedure init] codetoanalyze/objc/biabduction/blocks_in_heap/BlockInHeap.m, block_in_heap_executed_after_bi_abduction_ok_test, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure block_in_heap_executed_after_bi_abduction_ok_test(),start of procedure block_in_heap_executed_after_bi_abduction_ok_no_retain_cycle(),start of procedure assign_block_to_ivar,Executing synthesized setter setHandler:,return from a call to BlockInHeap.assign_block_to_ivar,Executing synthesized getter handler,start of procedure block,return from a call to objc_blockBlockInHeap.assign_block_to_ivar_1,return from a call to block_in_heap_executed_after_bi_abduction_ok_no_retain_cycle,Taking true branch] @@ -107,8 +107,8 @@ codetoanalyze/objc/biabduction/property/main.c, property_main, 3, MEMORY_LEAK, n codetoanalyze/objc/biabduction/resource_leaks/Dispatch_sources.m, ProcessContentsOfFile, 35, RESOURCE_LEAK, no_bucket, ERROR, [start of procedure ProcessContentsOfFile(),Taking false branch,Skipping dispatch_get_global_queue(): method has no implementation,Skipping dispatch_source_create(): method has no implementation,Taking false branch,Skipping dispatch_source_set_event_handler(): method has no implementation,Skipping dispatch_source_set_cancel_handler(): method has no implementation] codetoanalyze/objc/biabduction/resource_leaks/Dispatch_sources.m, objc_blockProcessContentsOfFile_2, 6, MEMORY_LEAK, no_bucket, ERROR, [start of procedure block,Skipping dispatch_source_get_data(): method has no implementation,Taking true branch,Skipping MyProcessFileData(): method has no implementation] codetoanalyze/objc/biabduction/resource_leaks/ResourceLeakExample.m, NSFileHandle.fileHandleForLoggingAtPath:mode:, 9, RESOURCE_LEAK, no_bucket, ERROR, [start of procedure fileHandleForLoggingAtPath:mode:,Taking true branch,Skipping fileSystemRepresentation: method has no implementation,Taking false branch,Taking true branch,Skipping autorelease: no implementation found for method declared in Objective-C protocol] -codetoanalyze/objc/shared/annotations/nonnull_annotations.m, A.test1:, 2, PARAMETER_NOT_NULL_CHECKED, B2, WARNING, [start of procedure test1:,Message child with receiver nil returns nil.] -codetoanalyze/objc/shared/annotations/nonnull_annotations.m, A.test3:, 1, PARAMETER_NOT_NULL_CHECKED, B1, WARNING, [start of procedure test3:] +codetoanalyze/objc/shared/annotations/nonnull_annotations.m, NonnullAnnot.test1:, 2, PARAMETER_NOT_NULL_CHECKED, B2, WARNING, [start of procedure test1:,Message child with receiver nil returns nil.] +codetoanalyze/objc/shared/annotations/nonnull_annotations.m, NonnullAnnot.test3:, 1, PARAMETER_NOT_NULL_CHECKED, B1, WARNING, [start of procedure test3:] codetoanalyze/objc/shared/annotations/nullable_annotations.m, User.otherUserName, 2, NULL_DEREFERENCE, B2, ERROR, [start of procedure otherUserName,Skipping otherUser: method has no implementation] codetoanalyze/objc/shared/annotations/nullable_annotations.m, npe_property_nullable, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure npe_property_nullable(),Skipping child: method has no implementation] codetoanalyze/objc/shared/annotations/nullable_annotations_fields.m, A.nullable_field, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure nullable_field,Skipping getA(): method has no implementation] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m.dot b/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m.dot index 1157e779e..f7f893f9e 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.m.dot @@ -60,6 +60,28 @@ digraph cfg { "capture#A#instance.d411336575e4bf632a1828f5f5979726_4" -> "capture#A#instance.d411336575e4bf632a1828f5f5979726_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n n$0=*&self:A* [line 50, column 1]\n n$1=*n$0._data:D* [line 50, column 1]\n n$2=_fun_D.dealloc(n$1:D*) [line 50, column 1]\n n$3=*&self:A* [line 50, column 1]\n n$4=*n$3._b:B* [line 50, column 1]\n n$5=_fun_B.dealloc(n$4:B*) [line 50, column 1]\n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_1" [label="1: Start B.dealloc\nFormals: self:B*\nLocals: \n " color=yellow style=filled] + + + "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_1" -> "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" ; +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_2" [label="2: Exit B.dealloc \n " color=yellow style=filled] + + +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" [label="3: Call dealloc \n n$6=*&self:B* [line 31, column 1]\n n$7=*n$6._d:D* [line 31, column 1]\n n$8=_fun_D.dealloc(n$7:D*) [line 31, column 1]\n " shape="box"] + + + "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" -> "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_2" ; "sHandler:#B#instance.590685250eb38eaab242405cd45c572b_1" [label="1: Start B.sHandler:\nFormals: self:B* h:_fn_(*)\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot b/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot index bb124e3a6..3c7587fe5 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot @@ -115,4 +115,15 @@ digraph cfg { "test_leak#A#class.8240788aa53244827857be0e92d27671_3" -> "test_leak#A#class.8240788aa53244827857be0e92d27671_2" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.m.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.m.dot index a1ca34209..fde3afcc3 100644 --- a/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_1" [label="1: Start Boxing.dealloc\nFormals: self:Boxing*\nLocals: \n " color=yellow style=filled] + + + "dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_1" -> "dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_3" ; +"dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_2" [label="2: Exit Boxing.dealloc \n " color=yellow style=filled] + + +"dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_3" -> "dealloc#Boxing#instance.569d9054e725a069b00d4e2aa3ade22c_2" ; "getBool#Boxing#instance.3315ec58788820860ec4adc889dd7197_1" [label="1: Start Boxing.getBool\nFormals: self:Boxing*\nLocals: n:NSNumber* \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m.dot b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m.dot index 9916e29d4..09805e0f7 100644 --- a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_1" [label="1: Start A.test4:\nFormals: self:A* x:int\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot index 1d3218f8c..086e78c89 100644 --- a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_1" [label="1: Start ExceptionExample.dealloc\nFormals: self:ExceptionExample*\nLocals: \n " color=yellow style=filled] + + + "dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_1" -> "dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_3" ; +"dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_2" [label="2: Exit ExceptionExample.dealloc \n " color=yellow style=filled] + + +"dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_3" -> "dealloc#ExceptionExample#instance.d3f98dfd383bac562b4173d739efcd78_2" ; "test#ExceptionExample#instance.513cde8d794322493646dbd1821516dd_1" [label="1: Start ExceptionExample.test\nFormals: self:ExceptionExample*\nLocals: s:NSString* \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot index aa8d95202..e8fc2bddf 100644 --- a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n n$0=*&self:A* [line 43, column 1]\n n$1=*n$0.reverseObjectEnumerator:NSEnumerator* [line 43, column 1]\n n$2=_fun_NSEnumerator.dealloc(n$1:NSEnumerator*) [line 43, column 1]\n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; "fast_loop:#A(class NSArray)#instance.26b39d1106e4365a40bc2f6305401611_1" [label="1: Start A.fast_loop:\nFormals: self:A* items:NSArray*\nLocals: item:NSArray* size:int \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/internal_forward_class/ForwardClassInMethod.m.dot b/infer/tests/codetoanalyze/objc/frontend/internal_forward_class/ForwardClassInMethod.m.dot index d21f5d81a..2d40a3e04 100644 --- a/infer/tests/codetoanalyze/objc/frontend/internal_forward_class/ForwardClassInMethod.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/internal_forward_class/ForwardClassInMethod.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; "foo#A#instance.a1bcc3cb6c1f00fc285817fb8454eaed_1" [label="1: Start A.foo\nFormals: self:A*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m.dot b/infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m.dot index d61521b5d..79fe26fc9 100644 --- a/infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/predefined_expr/PredefinedExprExample.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; "testFunct#A#instance.b6c9dae744220d93a4466679814728c1_1" [label="1: Start A.testFunct\nFormals: self:A*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m.dot b/infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m.dot index 4a75d017b..b35ea528c 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/PropertyCustomAccessor.m.dot @@ -1,3 +1,14 @@ /* @generated */ digraph cfg { +"dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_1" [label="1: Start ASDisplayNode.dealloc\nFormals: self:ASDisplayNode*\nLocals: \n " color=yellow style=filled] + + + "dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_1" -> "dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_3" ; +"dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_2" [label="2: Exit ASDisplayNode.dealloc \n " color=yellow style=filled] + + +"dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_3" -> "dealloc#ASDisplayNode#instance.2cf9321d9a068615e100a3ac2a62e774_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.m.dot b/infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.m.dot index 5d989db83..815405370 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/PropertyImplSetter.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_1" [label="1: Start PropertyImplSetter.dealloc\nFormals: self:PropertyImplSetter*\nLocals: \n " color=yellow style=filled] + + + "dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_1" -> "dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_3" ; +"dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_2" [label="2: Exit PropertyImplSetter.dealloc \n " color=yellow style=filled] + + +"dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_3" -> "dealloc#PropertyImplSetter#instance.5650d9bd0d7d0f070430d4aa59d7fb97_2" ; "setMaximumFileSize:#PropertyImplSetter#instance.1d600fefeeb62155817021d20e02a478_1" [label="1: Start PropertyImplSetter.setMaximumFileSize:\nFormals: self:PropertyImplSetter* newMaximumFileSize:int\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m.dot b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m.dot index b42f21c98..3e8d06727 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.m.dot @@ -11,4 +11,15 @@ digraph cfg { "addTarget:#A(class A)#instance.ca26ddd02ac11fb266531b38b6edef27_3" -> "addTarget:#A(class A)#instance.ca26ddd02ac11fb266531b38b6edef27_2" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/property/aclass.m.dot b/infer/tests/codetoanalyze/objc/frontend/property/aclass.m.dot index 4a75d017b..6db370b82 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/aclass.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/aclass.m.dot @@ -1,3 +1,14 @@ /* @generated */ digraph cfg { +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" [label="1: Start AClass.dealloc\nFormals: self:AClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" ; +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" [label="2: Exit AClass.dealloc \n " color=yellow style=filled] + + +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.m.dot b/infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.m.dot index 4a75d017b..55d0df4dc 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property_in_protocol/Test.m.dot @@ -1,3 +1,14 @@ /* @generated */ digraph cfg { +"dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_1" [label="1: Start Test.dealloc\nFormals: self:Test*\nLocals: \n " color=yellow style=filled] + + + "dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_1" -> "dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_3" ; +"dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_2" [label="2: Exit Test.dealloc \n " color=yellow style=filled] + + +"dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_3" -> "dealloc#Test#instance.5b6eb1b3af87ac0463c4245d2b33c913_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot index 9e5b26a2e..ddef40a41 100644 --- a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_1" [label="1: Start Bla.dealloc\nFormals: self:Bla*\nLocals: \n " color=yellow style=filled] + + + "dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_1" -> "dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_3" ; +"dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_2" [label="2: Exit Bla.dealloc \n " color=yellow style=filled] + + +"dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_3" -> "dealloc#Bla#instance.febc9b8c0e8bc29905272eecbf85b31a_2" ; "fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_1" [label="1: Start Bla.fooMethod\nFormals: self:Bla*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.m.dot b/infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.m.dot index 571fb2fe3..f5d0e7b8d 100644 --- a/infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/returnstmt/void_return.m.dot @@ -61,4 +61,15 @@ digraph cfg { "aMethod#MyClass#instance.af06019e61fb7341a36c141ed90caaaf_15" -> "aMethod#MyClass#instance.af06019e61fb7341a36c141ed90caaaf_14" ; +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_1" [label="1: Start MyClass.dealloc\nFormals: self:MyClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_1" -> "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" ; +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_2" [label="2: Exit MyClass.dealloc \n " color=yellow style=filled] + + +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" -> "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot b/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot index de12d1e84..950cfce8a 100644 --- a/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot @@ -207,6 +207,17 @@ digraph cfg { "class_method_fst_arg_of_class_method#A#instance.cf9f3087f45649c74ef1f7ca002450f2_3" -> "class_method_fst_arg_of_class_method#A#instance.cf9f3087f45649c74ef1f7ca002450f2_2" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; "init#A#instance.eee79aaaddd644404e17691a7e7d809a_1" [label="1: Start A.init\nFormals: self:A*\nLocals: \n " color=yellow style=filled] @@ -269,6 +280,17 @@ digraph cfg { "b_m#B#class.82af96ad418803b2f96fc1bfa1572c10_2" [label="2: Exit B.b_m \n " color=yellow style=filled] +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_1" [label="1: Start B.dealloc\nFormals: self:B*\nLocals: \n " color=yellow style=filled] + + + "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_1" -> "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" ; +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_2" [label="2: Exit B.dealloc \n " color=yellow style=filled] + + +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" -> "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_2" ; "isC:#B(struct objc_class)#instance.ab14fb7a19510df6032d65aa27b0f12d_1" [label="1: Start B.isC:\nFormals: self:B* aClass:objc_class*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/self_static/static.m.dot b/infer/tests/codetoanalyze/objc/frontend/self_static/static.m.dot index 10b53a930..13b3a1c74 100644 --- a/infer/tests/codetoanalyze/objc/frontend/self_static/static.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/self_static/static.m.dot @@ -44,6 +44,17 @@ digraph cfg { "anInstanceMethod2#MyClass#instance.d2b66ad8a2fe88927ba6f54fa43eabea_3" -> "anInstanceMethod2#MyClass#instance.d2b66ad8a2fe88927ba6f54fa43eabea_2" ; +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_1" [label="1: Start MyClass.dealloc\nFormals: self:MyClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_1" -> "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" ; +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_2" [label="2: Exit MyClass.dealloc \n " color=yellow style=filled] + + +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" -> "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_2" ; "getX#MyClass#instance.ddf21e5eecd35d40e2b277a5d6933812_1" [label="1: Start MyClass.getX\nFormals: self:MyClass*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.m.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.m.dot index bc2ff68b3..5b1d32ccd 100644 --- a/infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/subclass/MyClass.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_1" [label="1: Start MyClass.dealloc\nFormals: self:MyClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_1" -> "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" ; +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_2" [label="2: Exit MyClass.dealloc \n " color=yellow style=filled] + + +"dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_3" -> "dealloc#MyClass#instance.d6828163e8783bc124f5d6aa6c910fe9_2" ; "myNumber#MyClass#instance.b5167e9607437362e48461937478a06c_1" [label="1: Start MyClass.myNumber\nFormals: self:MyClass*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.m.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.m.dot index 0226bd901..950fee02d 100644 --- a/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_1" [label="1: Start MySubclass.dealloc\nFormals: self:MySubclass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_1" -> "dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_3" ; +"dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_2" [label="2: Exit MySubclass.dealloc \n " color=yellow style=filled] + + +"dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_3" -> "dealloc#MySubclass#instance.7590aea7a32bd87eca533e9d3022f10a_2" ; "myNumber#MySubclass#instance.8e9ae0ac35cf895ff25e7570cdce81aa_1" [label="1: Start MySubclass.myNumber\nFormals: self:MySubclass*\nLocals: subclassNumber:int \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/types/attributes.m.dot b/infer/tests/codetoanalyze/objc/frontend/types/attributes.m.dot index 84c215541..d46a7b6f2 100644 --- a/infer/tests/codetoanalyze/objc/frontend/types/attributes.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/types/attributes.m.dot @@ -55,4 +55,15 @@ digraph cfg { "main.fad58de7366495db4650cfefac2fcd61_14" -> "main.fad58de7366495db4650cfefac2fcd61_13" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" [label="1: Start A.dealloc\nFormals: self:A*\nLocals: \n " color=yellow style=filled] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_1" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" ; +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" [label="2: Exit A.dealloc \n " color=yellow style=filled] + + +"dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_3" -> "dealloc#A#instance.55ac864e91dcd5d484e8ab7d8eb94fcb_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/types/testloop.m.dot b/infer/tests/codetoanalyze/objc/frontend/types/testloop.m.dot index 70e6a1577..1c89c6d63 100644 --- a/infer/tests/codetoanalyze/objc/frontend/types/testloop.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/types/testloop.m.dot @@ -33,4 +33,15 @@ digraph cfg { "layoutToUse#FBScrollViewDelegateProxy#class.0fb14252876875c85e9253ab00bfb755_3" -> "layoutToUse#FBScrollViewDelegateProxy#class.0fb14252876875c85e9253ab00bfb755_2" ; +"dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_1" [label="1: Start FBScrollViewDelegateProxy.dealloc\nFormals: self:FBScrollViewDelegateProxy*\nLocals: \n " color=yellow style=filled] + + + "dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_1" -> "dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_3" ; +"dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_2" [label="2: Exit FBScrollViewDelegateProxy.dealloc \n " color=yellow style=filled] + + +"dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_3" -> "dealloc#FBScrollViewDelegateProxy#instance.be70c6b49a0df60d48868e383f3399dc_2" ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/types/void_call.m.dot b/infer/tests/codetoanalyze/objc/frontend/types/void_call.m.dot index a5b7f72a3..1c90ffec2 100644 --- a/infer/tests/codetoanalyze/objc/frontend/types/void_call.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/types/void_call.m.dot @@ -81,6 +81,17 @@ digraph cfg { "bar:#AClass#instance.c024d9849ec28286083491e7c46a4982_3" -> "bar:#AClass#instance.c024d9849ec28286083491e7c46a4982_2" ; +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" [label="1: Start AClass.dealloc\nFormals: self:AClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" ; +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" [label="2: Exit AClass.dealloc \n " color=yellow style=filled] + + +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" ; "foo:#AClass#instance.85442408d439a21334483f95effd3023_1" [label="1: Start AClass.foo:\nFormals: self:AClass* a:int\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.m.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.m.dot index ac0a28865..5fc3eb7b4 100644 --- a/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" [label="1: Start AClass.dealloc\nFormals: self:AClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" ; +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" [label="2: Exit AClass.dealloc \n " color=yellow style=filled] + + +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" ; "sharedInstance#AClass#instance.07ceaad875949bf6aaa9dc5e3605f563_1" [label="1: Start AClass.sharedInstance\nFormals: self:AClass*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.m.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.m.dot index be6bc5ec5..51f7c931c 100644 --- a/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/vardecl/aclass_2.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" [label="1: Start AClass.dealloc\nFormals: self:AClass*\nLocals: \n " color=yellow style=filled] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_1" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" ; +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" [label="2: Exit AClass.dealloc \n " color=yellow style=filled] + + +"dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_3" -> "dealloc#AClass#instance.5339a8e9aec421a1f58ba25e08faeb6b_2" ; "sharedInstance#AClass#instance.07ceaad875949bf6aaa9dc5e3605f563_1" [label="1: Start AClass.sharedInstance\nFormals: self:AClass*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/liveness/NSParameterAssertExample.m b/infer/tests/codetoanalyze/objc/liveness/NSParameterAssertExample.m index 1af685e16..c14dd8848 100644 --- a/infer/tests/codetoanalyze/objc/liveness/NSParameterAssertExample.m +++ b/infer/tests/codetoanalyze/objc/liveness/NSParameterAssertExample.m @@ -6,10 +6,10 @@ */ #import -@interface A : NSObject +@interface AssertExample : NSObject @end -@implementation A +@implementation AssertExample + (void)foo { if (!(1)) { diff --git a/infer/tests/codetoanalyze/objc/liveness/NestedClassCalls.m b/infer/tests/codetoanalyze/objc/liveness/NestedClassCalls.m index 5617beb2a..ebbfdbbef 100644 --- a/infer/tests/codetoanalyze/objc/liveness/NestedClassCalls.m +++ b/infer/tests/codetoanalyze/objc/liveness/NestedClassCalls.m @@ -6,30 +6,31 @@ */ #import -@interface A : NSObject +@interface NestedClass : NSObject @property int val; @end bool myrand(); -@implementation A +@implementation NestedClass - (instancetype)myDoO:(id)o { return self; } + (instancetype)initWithVal:(int)v { - A* a = [A alloc]; + NestedClass* a = [NestedClass alloc]; a.val = v; return a; } + (instancetype)nestedGood { const BOOL isB = myrand(); - return [[[A initWithVal:isB ? 0 : 1] myDoO:[NSObject class]] + return [[[NestedClass initWithVal:isB ? 0 : 1] myDoO:[NSObject class]] myDoO:[NSObject class]]; } + (instancetype)nestedBad { const BOOL isB = myrand(); - return [[[A initWithVal:42] myDoO:[NSObject class]] myDoO:[NSObject class]]; + return [[[NestedClass initWithVal:42] myDoO:[NSObject class]] + myDoO:[NSObject class]]; } @end diff --git a/infer/tests/codetoanalyze/objc/liveness/issues.exp b/infer/tests/codetoanalyze/objc/liveness/issues.exp index d03705c91..5058f688c 100644 --- a/infer/tests/codetoanalyze/objc/liveness/issues.exp +++ b/infer/tests/codetoanalyze/objc/liveness/issues.exp @@ -1 +1 @@ -codetoanalyze/objc/liveness/NestedClassCalls.m, A.nestedBad, 1, DEAD_STORE, no_bucket, ERROR, [Write of unused value] +codetoanalyze/objc/liveness/NestedClassCalls.m, NestedClass.nestedBad, 1, DEAD_STORE, no_bucket, ERROR, [Write of unused value] diff --git a/infer/tests/codetoanalyze/objc/pulse/DeallocCalls.m b/infer/tests/codetoanalyze/objc/pulse/DeallocCalls.m index bc1e400b0..4e777966e 100644 --- a/infer/tests/codetoanalyze/objc/pulse/DeallocCalls.m +++ b/infer/tests/codetoanalyze/objc/pulse/DeallocCalls.m @@ -71,7 +71,9 @@ void memory_leak_raii_leak_bad() { BufferContainer2* b = [[BufferContainer2 alloc] init]; } -/* a goes out of scope, this causes a->b->_container to be leaked. This is a FP -because dealloc is called, and it should call dealloc of b which would free -_container. This behaviour is still to be implemented. */ -void memory_leak_raii_no_leak_ok_FP() { Araii* a = [[Araii alloc] init]; } +/* a goes out of scope, this causes a->_container->_buffer to be leaked. +However, dealloc of Arrai is called which triggers dealloc of BufferContainer1 +to be called and _buffer is freed there, so no leak. */ +void memory_leak_raii_no_leak_in_object_tree_ok() { + Araii* a = [[Araii alloc] init]; +} diff --git a/infer/tests/codetoanalyze/objc/pulse/issues.exp b/infer/tests/codetoanalyze/objc/pulse/issues.exp index 2de2df09f..01576e794 100644 --- a/infer/tests/codetoanalyze/objc/pulse/issues.exp +++ b/infer/tests/codetoanalyze/objc/pulse/issues.exp @@ -1,5 +1,4 @@ codetoanalyze/objc/pulse/DeallocCalls.m, memory_leak_raii_leak_bad, 1, PULSE_MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,when calling `BufferContainer2.init` here,allocated by call to `malloc_no_fail` (modelled),allocation part of the trace ends here,memory becomes unreachable here] -codetoanalyze/objc/pulse/DeallocCalls.m, memory_leak_raii_no_leak_ok_FP, 0, PULSE_MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,when calling `Araii.init` here,when calling `BufferContainer1.init` here,allocated by call to `malloc_no_fail` (modelled),allocation part of the trace ends here,memory becomes unreachable here] codetoanalyze/objc/pulse/MallocInObjC.m, leak_bad, 0, PULSE_MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,allocated by call to `malloc_no_fail` (modelled),allocation part of the trace ends here,memory becomes unreachable here] codetoanalyze/objc/pulse/MemoryLeaks.m, MemoryLeaks.call_no_bridge_leak_bad, 1, PULSE_MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,when calling `MemoryLeaks.ret_no_bridge` here,allocated by call to `CFLocaleCreate` (modelled),allocation part of the trace ends here,memory becomes unreachable here] codetoanalyze/objc/pulse/MemoryLeaks.m, MemoryLeaks.cg_path_create_mutable_leak_bad:, 2, PULSE_MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,allocated by call to `CGPathCreateMutable` (modelled),allocation part of the trace ends here,memory becomes unreachable here] diff --git a/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m b/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m index e3d0218cb..47d38487f 100644 --- a/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m +++ b/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m @@ -6,13 +6,13 @@ */ #import -@interface A : NSObject +@interface NonnullAnnot : NSObject -@property A* child; +@property NonnullAnnot* child; @end -@implementation A { +@implementation NonnullAnnot { int x; } @@ -20,13 +20,13 @@ return self; } -- (int)test1:(A*)a { - A* aa = [a child]; +- (int)test1:(NonnullAnnot*)a { + NonnullAnnot* aa = [a child]; return aa->x; } -- (int)test2:(nonnull A*)a { - A* aa = [a child]; +- (int)test2:(nonnull NonnullAnnot*)a { + NonnullAnnot* aa = [a child]; return aa->x; } diff --git a/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m.dot b/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m.dot index 801ad2126..5227ac57e 100644 --- a/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/annotations/nonnull_annotations.m.dot @@ -1,74 +1,85 @@ /* @generated */ digraph cfg { -"init#A#instance.eee79aaaddd644404e17691a7e7d809a_1" [label="1: Start A.init\nFormals: self:A*\nLocals: \n " color=yellow style=filled] +"dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_1" [label="1: Start NonnullAnnot.dealloc\nFormals: self:NonnullAnnot*\nLocals: \n " color=yellow style=filled] - "init#A#instance.eee79aaaddd644404e17691a7e7d809a_1" -> "init#A#instance.eee79aaaddd644404e17691a7e7d809a_3" ; -"init#A#instance.eee79aaaddd644404e17691a7e7d809a_2" [label="2: Exit A.init \n " color=yellow style=filled] + "dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_1" -> "dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_3" ; +"dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_2" [label="2: Exit NonnullAnnot.dealloc \n " color=yellow style=filled] -"init#A#instance.eee79aaaddd644404e17691a7e7d809a_3" [label="3: Return Stmt \n n$0=*&self:A* [line 20, column 10]\n *&return:objc_object*=n$0 [line 20, column 3]\n " shape="box"] +"dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_3" [label="3: Call dealloc \n n$0=*&self:NonnullAnnot* [line 43, column 1]\n n$1=*n$0._child:NonnullAnnot* [line 43, column 1]\n n$2=_fun_NonnullAnnot.dealloc(n$1:NonnullAnnot*) [line 43, column 1]\n " shape="box"] - "init#A#instance.eee79aaaddd644404e17691a7e7d809a_3" -> "init#A#instance.eee79aaaddd644404e17691a7e7d809a_2" ; -"test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_1" [label="1: Start A.test1:\nFormals: self:A* a:A*\nLocals: aa:A* \n " color=yellow style=filled] + "dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_3" -> "dealloc#NonnullAnnot#instance.0759b4c4bc783d3b87f6d785a8b2c369_2" ; +"init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_1" [label="1: Start NonnullAnnot.init\nFormals: self:NonnullAnnot*\nLocals: \n " color=yellow style=filled] - "test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_1" -> "test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_4" ; -"test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_2" [label="2: Exit A.test1: \n " color=yellow style=filled] + "init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_1" -> "init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_3" ; +"init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_2" [label="2: Exit NonnullAnnot.init \n " color=yellow style=filled] -"test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_3" [label="3: Return Stmt \n n$1=*&aa:A* [line 25, column 10]\n n$2=*n$1.x:int [line 25, column 10]\n *&return:int=n$2 [line 25, column 3]\n " shape="box"] +"init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_3" [label="3: Return Stmt \n n$0=*&self:NonnullAnnot* [line 20, column 10]\n *&return:objc_object*=n$0 [line 20, column 3]\n " shape="box"] - "test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_3" -> "test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_2" ; -"test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_4" [label="4: DeclStmt \n VARIABLE_DECLARED(aa:A*); [line 24, column 3]\n n$3=*&a:A* [line 24, column 12]\n n$4=_fun_A.child(n$3:A*) [line 24, column 11]\n *&aa:A*=n$4 [line 24, column 3]\n " shape="box"] + "init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_3" -> "init#NonnullAnnot#instance.b2b74f8dde6ae5957922f59d81ccda45_2" ; +"test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_1" [label="1: Start NonnullAnnot.test1:\nFormals: self:NonnullAnnot* a:NonnullAnnot*\nLocals: aa:NonnullAnnot* \n " color=yellow style=filled] - "test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_4" -> "test1:#A(class A)#instance.61440711d4e2388d4be3731c34a61289_3" ; -"test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_1" [label="1: Start A.test2:\nFormals: self:A* a:A*\nLocals: aa:A*\nAnnotation: <> A.test2:(<> <_Nonnull>) \n " color=yellow style=filled] + "test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_1" -> "test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_4" ; +"test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_2" [label="2: Exit NonnullAnnot.test1: \n " color=yellow style=filled] - "test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_1" -> "test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_4" ; -"test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_2" [label="2: Exit A.test2: \n " color=yellow style=filled] +"test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_3" [label="3: Return Stmt \n n$1=*&aa:NonnullAnnot* [line 25, column 10]\n n$2=*n$1.x:int [line 25, column 10]\n *&return:int=n$2 [line 25, column 3]\n " shape="box"] -"test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_3" [label="3: Return Stmt \n n$5=*&aa:A* [line 30, column 10]\n n$6=*n$5.x:int [line 30, column 10]\n *&return:int=n$6 [line 30, column 3]\n " shape="box"] + "test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_3" -> "test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_2" ; +"test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_4" [label="4: DeclStmt \n VARIABLE_DECLARED(aa:NonnullAnnot*); [line 24, column 3]\n n$3=*&a:NonnullAnnot* [line 24, column 23]\n n$4=_fun_NonnullAnnot.child(n$3:NonnullAnnot*) [line 24, column 22]\n *&aa:NonnullAnnot*=n$4 [line 24, column 3]\n " shape="box"] - "test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_3" -> "test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_2" ; -"test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_4" [label="4: DeclStmt \n VARIABLE_DECLARED(aa:A*); [line 29, column 3]\n n$7=*&a:A* [line 29, column 12]\n n$8=_fun_A.child(n$7:A*) [line 29, column 11]\n *&aa:A*=n$8 [line 29, column 3]\n " shape="box"] + "test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_4" -> "test1:#NonnullAnnot(class NonnullAnnot)#instance.e1bfc3674bdae0a62d7e4bb2a1768f99_3" ; +"test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_1" [label="1: Start NonnullAnnot.test2:\nFormals: self:NonnullAnnot* a:NonnullAnnot*\nLocals: aa:NonnullAnnot*\nAnnotation: <> NonnullAnnot.test2:(<> <_Nonnull>) \n " color=yellow style=filled] - "test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_4" -> "test2:#A(class A)#instance.3b9594b6f023617f19d57dee6d35cf80_3" ; -"test3:#A#instance.28bc2df8df797b21818dc2037239f326_1" [label="1: Start A.test3:\nFormals: self:A* successBlock:_fn_(*)\nLocals: \n " color=yellow style=filled] + "test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_1" -> "test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_4" ; +"test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_2" [label="2: Exit NonnullAnnot.test2: \n " color=yellow style=filled] - "test3:#A#instance.28bc2df8df797b21818dc2037239f326_1" -> "test3:#A#instance.28bc2df8df797b21818dc2037239f326_4" ; -"test3:#A#instance.28bc2df8df797b21818dc2037239f326_2" [label="2: Exit A.test3: \n " color=yellow style=filled] +"test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_3" [label="3: Return Stmt \n n$5=*&aa:NonnullAnnot* [line 30, column 10]\n n$6=*n$5.x:int [line 30, column 10]\n *&return:int=n$6 [line 30, column 3]\n " shape="box"] -"test3:#A#instance.28bc2df8df797b21818dc2037239f326_3" [label="3: Return Stmt \n *&return:int=0 [line 35, column 3]\n " shape="box"] + "test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_3" -> "test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_2" ; +"test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_4" [label="4: DeclStmt \n VARIABLE_DECLARED(aa:NonnullAnnot*); [line 29, column 3]\n n$7=*&a:NonnullAnnot* [line 29, column 23]\n n$8=_fun_NonnullAnnot.child(n$7:NonnullAnnot*) [line 29, column 22]\n *&aa:NonnullAnnot*=n$8 [line 29, column 3]\n " shape="box"] - "test3:#A#instance.28bc2df8df797b21818dc2037239f326_3" -> "test3:#A#instance.28bc2df8df797b21818dc2037239f326_2" ; -"test3:#A#instance.28bc2df8df797b21818dc2037239f326_4" [label="4: Call n$9 \n n$9=*&successBlock:_fn_(*) [line 34, column 3]\n n$10=_fun_NSString.stringWithUTF8String:(\"Yay\":char* const ) [line 34, column 16]\n n$11=n$9(n$10:NSString*) objc_block [line 34, column 3]\n " shape="box"] + "test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_4" -> "test2:#NonnullAnnot(class NonnullAnnot)#instance.7992ca7f61dca07dd40b2e7d7603a016_3" ; +"test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_1" [label="1: Start NonnullAnnot.test3:\nFormals: self:NonnullAnnot* successBlock:_fn_(*)\nLocals: \n " color=yellow style=filled] - "test3:#A#instance.28bc2df8df797b21818dc2037239f326_4" -> "test3:#A#instance.28bc2df8df797b21818dc2037239f326_3" ; -"test4:#A#instance.718a300d6fa63609a70f22221a548ee5_1" [label="1: Start A.test4:\nFormals: self:A* successBlock:_fn_(*)\nLocals: \nAnnotation: <> A.test4:(<> <_Nonnull>) \n " color=yellow style=filled] + "test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_1" -> "test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_4" ; +"test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_2" [label="2: Exit NonnullAnnot.test3: \n " color=yellow style=filled] - "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_1" -> "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_4" ; -"test4:#A#instance.718a300d6fa63609a70f22221a548ee5_2" [label="2: Exit A.test4: \n " color=yellow style=filled] +"test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_3" [label="3: Return Stmt \n *&return:int=0 [line 35, column 3]\n " shape="box"] -"test4:#A#instance.718a300d6fa63609a70f22221a548ee5_3" [label="3: Return Stmt \n *&return:int=0 [line 40, column 3]\n " shape="box"] + "test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_3" -> "test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_2" ; +"test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_4" [label="4: Call n$9 \n n$9=*&successBlock:_fn_(*) [line 34, column 3]\n n$10=_fun_NSString.stringWithUTF8String:(\"Yay\":char* const ) [line 34, column 16]\n n$11=n$9(n$10:NSString*) objc_block [line 34, column 3]\n " shape="box"] - "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_3" -> "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_2" ; -"test4:#A#instance.718a300d6fa63609a70f22221a548ee5_4" [label="4: Call n$12 \n n$12=*&successBlock:_fn_(*) [line 39, column 3]\n n$13=_fun_NSString.stringWithUTF8String:(\"Yay\":char* const ) [line 39, column 16]\n n$14=n$12(n$13:NSString*) objc_block [line 39, column 3]\n " shape="box"] + "test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_4" -> "test3:#NonnullAnnot#instance.4ab04a3232d4ec4327b6040285f16196_3" ; +"test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_1" [label="1: Start NonnullAnnot.test4:\nFormals: self:NonnullAnnot* successBlock:_fn_(*)\nLocals: \nAnnotation: <> NonnullAnnot.test4:(<> <_Nonnull>) \n " color=yellow style=filled] - "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_4" -> "test4:#A#instance.718a300d6fa63609a70f22221a548ee5_3" ; + "test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_1" -> "test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_4" ; +"test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_2" [label="2: Exit NonnullAnnot.test4: \n " color=yellow style=filled] + + +"test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_3" [label="3: Return Stmt \n *&return:int=0 [line 40, column 3]\n " shape="box"] + + + "test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_3" -> "test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_2" ; +"test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_4" [label="4: Call n$12 \n n$12=*&successBlock:_fn_(*) [line 39, column 3]\n n$13=_fun_NSString.stringWithUTF8String:(\"Yay\":char* const ) [line 39, column 16]\n n$14=n$12(n$13:NSString*) objc_block [line 39, column 3]\n " shape="box"] + + + "test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_4" -> "test4:#NonnullAnnot#instance.679c6b135de319b66e5e0bd6ab2f0b43_3" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/annotations/nullable_annotations.m.dot b/infer/tests/codetoanalyze/objc/shared/annotations/nullable_annotations.m.dot index 1bf96ebb6..c10ae2695 100644 --- a/infer/tests/codetoanalyze/objc/shared/annotations/nullable_annotations.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/annotations/nullable_annotations.m.dot @@ -19,6 +19,17 @@ digraph cfg { "npe_property_nullable.ba4461b16b55481ab8de5124734d2bf3_5" -> "npe_property_nullable.ba4461b16b55481ab8de5124734d2bf3_4" ; +"dealloc#User#instance.845406211d2df26e556b3165fd367f01_1" [label="1: Start User.dealloc\nFormals: self:User*\nLocals: \n " color=yellow style=filled] + + + "dealloc#User#instance.845406211d2df26e556b3165fd367f01_1" -> "dealloc#User#instance.845406211d2df26e556b3165fd367f01_3" ; +"dealloc#User#instance.845406211d2df26e556b3165fd367f01_2" [label="2: Exit User.dealloc \n " color=yellow style=filled] + + +"dealloc#User#instance.845406211d2df26e556b3165fd367f01_3" [label="3: Call dealloc \n n$0=*&self:User* [line 59, column 1]\n n$1=*n$0._name:NSString* [line 59, column 1]\n n$2=_fun_NSString.dealloc(n$1:NSString*) [line 59, column 1]\n " shape="box"] + + + "dealloc#User#instance.845406211d2df26e556b3165fd367f01_3" -> "dealloc#User#instance.845406211d2df26e556b3165fd367f01_2" ; "initWithName:#User(class NSString)#instance.1755f5e97d3aa5318dd071b864db9bb7_1" [label="1: Start User.initWithName:\nFormals: self:User* name:NSString*\nLocals: \nAnnotation: <_Nullable> User.initWithName:(<> <_Nullable>) \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/block/BlockVar.m.dot b/infer/tests/codetoanalyze/objc/shared/block/BlockVar.m.dot index 344b0d7fd..cd9d50f5e 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/BlockVar.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/BlockVar.m.dot @@ -206,4 +206,15 @@ digraph cfg { "capturedNullDeref#BlockVar#instance.48c44f7ae26caf7a1ac522523ebac894_5" -> "capturedNullDeref#BlockVar#instance.48c44f7ae26caf7a1ac522523ebac894_4" ; +"dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_1" [label="1: Start BlockVar.dealloc\nFormals: self:BlockVar*\nLocals: \n " color=yellow style=filled] + + + "dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_1" -> "dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_3" ; +"dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_2" [label="2: Exit BlockVar.dealloc \n " color=yellow style=filled] + + +"dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_3" -> "dealloc#BlockVar#instance.2dd2255ffab933047f591c2d917b519f_2" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/block/Blocks_as_parameters.m.dot b/infer/tests/codetoanalyze/objc/shared/block/Blocks_as_parameters.m.dot index 4f11ea6f7..1348fda56 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/Blocks_as_parameters.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/Blocks_as_parameters.m.dot @@ -11,6 +11,17 @@ digraph cfg { "objc_blockB.f_1(class B).c1c611f4be5cea3fe56d67e34da1fffd_3" -> "objc_blockB.f_1(class B).c1c611f4be5cea3fe56d67e34da1fffd_2" ; +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_1" [label="1: Start B.dealloc\nFormals: self:B*\nLocals: \n " color=yellow style=filled] + + + "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_1" -> "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" ; +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_2" [label="2: Exit B.dealloc \n " color=yellow style=filled] + + +"dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_3" -> "dealloc#B#instance.8757740e0d47129962d40fbccbdf4d3f_2" ; "f#B#instance.f1371ff5e7f410d3df6a2e71ff0a814e_1" [label="1: Start B.f\nFormals: self:B*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/block/block-it.m.dot b/infer/tests/codetoanalyze/objc/shared/block/block-it.m.dot index 6812c18d0..904242de0 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/block-it.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/block-it.m.dot @@ -152,4 +152,15 @@ digraph cfg { "array_trans#MyBlock#instance.13289a590560d0628a3ae5174e716a32_20" -> "array_trans#MyBlock#instance.13289a590560d0628a3ae5174e716a32_19" ; +"dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_1" [label="1: Start MyBlock.dealloc\nFormals: self:MyBlock*\nLocals: \n " color=yellow style=filled] + + + "dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_1" -> "dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_3" ; +"dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_2" [label="2: Exit MyBlock.dealloc \n " color=yellow style=filled] + + +"dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_3" -> "dealloc#MyBlock#instance.0e3e837931da12de231d46e0429d2d6c_2" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m b/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m index 5f57f40dd..12c038577 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m +++ b/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m @@ -9,12 +9,12 @@ int g; -@interface My_manager : NSObject +@interface Block_no_args : NSObject - (int)m; @end -@implementation My_manager +@implementation Block_no_args - (int)m { g = 7; diff --git a/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m.dot b/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m.dot index 404c650f5..d688eed67 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/block_no_args.m.dot @@ -1,70 +1,81 @@ /* @generated */ digraph cfg { -"objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_1" [label="1: Start objc_blockMy_manager.m_1\nFormals: z:int\nLocals: \nCaptured: z:int \n " color=yellow style=filled] +"objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_1" [label="1: Start objc_blockBlock_no_args.m_1\nFormals: z:int\nLocals: \nCaptured: z:int \n " color=yellow style=filled] - "objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_1" -> "objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_3" ; -"objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_2" [label="2: Exit objc_blockMy_manager.m_1 \n " color=yellow style=filled] + "objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_1" -> "objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_3" ; +"objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_2" [label="2: Exit objc_blockBlock_no_args.m_1 \n " color=yellow style=filled] -"objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_3" [label="3: BinaryOperatorStmt: Assign \n n$8=*&z:int [line 24, column 9]\n *&#GB$g:int=(n$8 + 3) [line 24, column 5]\n " shape="box"] +"objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_3" [label="3: BinaryOperatorStmt: Assign \n n$8=*&z:int [line 24, column 9]\n *&#GB$g:int=(n$8 + 3) [line 24, column 5]\n " shape="box"] - "objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_3" -> "objc_blockMy_manager.m_1.d933a5f9ad39365b735134c5f5009061_2" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_1" [label="1: Start My_manager.m\nFormals: self:My_manager*\nLocals: p:int* z:int b:_fn_(*) \n " color=yellow style=filled] + "objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_3" -> "objc_blockBlock_no_args.m_1.4d7585adf186f5ddc971eca39c81e1b8_2" ; +"dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_1" [label="1: Start Block_no_args.dealloc\nFormals: self:Block_no_args*\nLocals: \n " color=yellow style=filled] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_1" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_14" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_2" [label="2: Exit My_manager.m \n " color=yellow style=filled] + "dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_1" -> "dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_3" ; +"dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_2" [label="2: Exit Block_no_args.dealloc \n " color=yellow style=filled] -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_3" [label="3: + \n " ] +"dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_3" [label="3: Call dealloc \n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_3" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_4" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_4" [label="4: between_join_and_exit \n " shape="box"] + "dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_3" -> "dealloc#Block_no_args#instance.eac76c4150c7c9dce7f36154adee0b59_2" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_1" [label="1: Start Block_no_args.m\nFormals: self:Block_no_args*\nLocals: p:int* z:int b:_fn_(*) \n " color=yellow style=filled] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_4" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_2" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_5" [label="5: BinaryOperatorStmt: EQ \n n$0=*&#GB$g:int [line 28, column 7]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_1" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_14" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_2" [label="2: Exit Block_no_args.m \n " color=yellow style=filled] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_5" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_6" ; - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_5" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_7" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_6" [label="6: Prune (true branch, if) \n PRUNE((n$0 == 6), true); [line 28, column 7]\n " shape="invhouse"] +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_3" [label="3: + \n " ] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_6" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_8" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_7" [label="7: Prune (false branch, if) \n PRUNE(!(n$0 == 6), false); [line 28, column 7]\n " shape="invhouse"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_3" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_4" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_4" [label="4: between_join_and_exit \n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_7" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_9" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_8" [label="8: Return Stmt \n n$1=*&p:int* [line 29, column 13]\n n$2=*n$1:int [line 29, column 12]\n *&return:int=n$2 [line 29, column 5]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_4" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_2" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_5" [label="5: BinaryOperatorStmt: EQ \n n$0=*&#GB$g:int [line 28, column 7]\n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_8" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_2" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_9" [label="9: Return Stmt \n n$3=*&z:int [line 31, column 12]\n *&return:int=n$3 [line 31, column 5]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_5" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_6" ; + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_5" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_7" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_6" [label="6: Prune (true branch, if) \n PRUNE((n$0 == 6), true); [line 28, column 7]\n " shape="invhouse"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_9" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_2" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_10" [label="10: DeclStmt \n VARIABLE_DECLARED(p:int*); [line 27, column 3]\n *&p:int*=null [line 27, column 3]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_6" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_8" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_7" [label="7: Prune (false branch, if) \n PRUNE(!(n$0 == 6), false); [line 28, column 7]\n " shape="invhouse"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_10" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_5" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_11" [label="11: Call n$5 \n n$5=*&b:_fn_(*) [line 26, column 3]\n n$6=n$5() objc_block [line 26, column 3]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_7" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_9" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_8" [label="8: Return Stmt \n n$1=*&p:int* [line 29, column 13]\n n$2=*n$1:int [line 29, column 12]\n *&return:int=n$2 [line 29, column 5]\n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_11" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_10" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_12" [label="12: BinaryOperatorStmt: Assign \n n$7=*&z:int [line 23, column 7]\n *&b:_fn_(*)=(_fun_objc_blockMy_manager.m_1,(n$7 &z:int)) [line 23, column 3]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_8" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_2" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_9" [label="9: Return Stmt \n n$3=*&z:int [line 31, column 12]\n *&return:int=n$3 [line 31, column 5]\n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_12" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_11" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_13" [label="13: DeclStmt \n VARIABLE_DECLARED(z:int); [line 22, column 3]\n *&z:int=3 [line 22, column 3]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_9" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_2" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_10" [label="10: DeclStmt \n VARIABLE_DECLARED(p:int*); [line 27, column 3]\n *&p:int*=null [line 27, column 3]\n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_13" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_12" ; -"m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_14" [label="14: BinaryOperatorStmt: Assign \n *&#GB$g:int=7 [line 20, column 3]\n " shape="box"] + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_10" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_5" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_11" [label="11: Call n$5 \n n$5=*&b:_fn_(*) [line 26, column 3]\n n$6=n$5() objc_block [line 26, column 3]\n " shape="box"] - "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_14" -> "m#My_manager#instance.e773f849d062cb9801497b62f5c98f5e_13" ; + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_11" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_10" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_12" [label="12: BinaryOperatorStmt: Assign \n n$7=*&z:int [line 23, column 7]\n *&b:_fn_(*)=(_fun_objc_blockBlock_no_args.m_1,(n$7 &z:int)) [line 23, column 3]\n " shape="box"] + + + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_12" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_11" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_13" [label="13: DeclStmt \n VARIABLE_DECLARED(z:int); [line 22, column 3]\n *&z:int=3 [line 22, column 3]\n " shape="box"] + + + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_13" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_12" ; +"m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_14" [label="14: BinaryOperatorStmt: Assign \n *&#GB$g:int=7 [line 20, column 3]\n " shape="box"] + + + "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_14" -> "m#Block_no_args#instance.385f8c4982ef6acc28cdc868a8cd4272_13" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/block/block_release.m.dot b/infer/tests/codetoanalyze/objc/shared/block/block_release.m.dot index d04f0d60e..1b118ff01 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/block_release.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/block_release.m.dot @@ -76,4 +76,15 @@ digraph cfg { "blockReleaseNoLeak#My_manager#instance.0c48f80f024250b18a529440f1313af6_12" -> "blockReleaseNoLeak#My_manager#instance.0c48f80f024250b18a529440f1313af6_11" ; +"dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_1" [label="1: Start My_manager.dealloc\nFormals: self:My_manager*\nLocals: \n " color=yellow style=filled] + + + "dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_1" -> "dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_3" ; +"dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_2" [label="2: Exit My_manager.dealloc \n " color=yellow style=filled] + + +"dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_3" -> "dealloc#My_manager#instance.62748019ba808efecf04f93dd9aba402_2" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot index 48fe4dc52..f91660b1d 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot @@ -213,6 +213,17 @@ digraph cfg { "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_5" -> "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" ; +"dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_1" [label="1: Start DispatchA.dealloc\nFormals: self:DispatchA*\nLocals: \n " color=yellow style=filled] + + + "dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_1" -> "dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_3" ; +"dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_2" [label="2: Exit DispatchA.dealloc \n " color=yellow style=filled] + + +"dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_3" -> "dealloc#DispatchA#instance.efcbb5cd324f6ef16ae8c5197a17f974_2" ; "init#DispatchA#instance.ff6c7b9a5a49bb46493519a4290a6582_1" [label="1: Start DispatchA.init\nFormals: self:DispatchA*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot b/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot index 2b5cd1600..c0d058d0a 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot @@ -204,6 +204,17 @@ digraph cfg { "dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_5" -> "dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_4" ; +"dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_1" [label="1: Start DispatchEx.dealloc\nFormals: self:DispatchEx*\nLocals: \n " color=yellow style=filled] + + + "dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_1" -> "dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_3" ; +"dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_2" [label="2: Exit DispatchEx.dealloc \n " color=yellow style=filled] + + +"dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_3" -> "dealloc#DispatchEx#instance.bdeaca414e9a942022acc0c08806f472_2" ; "init#DispatchEx#instance.04117ac30ba5664de2d577c4aa97d118_1" [label="1: Start DispatchEx.init\nFormals: self:DispatchEx*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/field_superclass/SuperExample.m.dot b/infer/tests/codetoanalyze/objc/shared/field_superclass/SuperExample.m.dot index 37de7fc13..3d77d40cb 100644 --- a/infer/tests/codetoanalyze/objc/shared/field_superclass/SuperExample.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/field_superclass/SuperExample.m.dot @@ -11,6 +11,17 @@ digraph cfg { "super_example_main.e3ebe95e6c5ae811733f235c29fbbf6d_3" -> "super_example_main.e3ebe95e6c5ae811733f235c29fbbf6d_2" ; +"dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_1" [label="1: Start ASuper.dealloc\nFormals: self:ASuper*\nLocals: \n " color=yellow style=filled] + + + "dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_1" -> "dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_3" ; +"dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_2" [label="2: Exit ASuper.dealloc \n " color=yellow style=filled] + + +"dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_3" -> "dealloc#ASuper#instance.d4e2053955a905d19c2f334e81096e84_2" ; "init#ASuper#instance.9832dae2a83c036d9d82b45709c4855e_1" [label="1: Start ASuper.init\nFormals: self:ASuper*\nLocals: \n " color=yellow style=filled] @@ -30,6 +41,17 @@ digraph cfg { "init#ASuper#instance.9832dae2a83c036d9d82b45709c4855e_5" -> "init#ASuper#instance.9832dae2a83c036d9d82b45709c4855e_4" ; +"dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_1" [label="1: Start BSuper.dealloc\nFormals: self:BSuper*\nLocals: \n " color=yellow style=filled] + + + "dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_1" -> "dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_3" ; +"dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_2" [label="2: Exit BSuper.dealloc \n " color=yellow style=filled] + + +"dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_3" -> "dealloc#BSuper#instance.12f39640b96655b7899644ca00bba8a4_2" ; "init#BSuper#instance.6678b088cbd2579c21b766781beb8030_1" [label="1: Start BSuper.init\nFormals: self:BSuper*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/ArcExample.m.dot b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/ArcExample.m.dot index 888104193..3d4d2f5c3 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/ArcExample.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/ArcExample.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_1" [label="1: Start ArcA.dealloc\nFormals: self:ArcA*\nLocals: \n " color=yellow style=filled] + + + "dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_1" -> "dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_3" ; +"dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_2" [label="2: Exit ArcA.dealloc \n " color=yellow style=filled] + + +"dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_3" [label="3: Call dealloc \n n$0=*&self:ArcA* [line 31, column 1]\n n$1=*n$0._son:ArcA* [line 31, column 1]\n n$2=_fun_ArcA.dealloc(n$1:ArcA*) [line 31, column 1]\n " shape="box"] + + + "dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_3" -> "dealloc#ArcA#instance.89cdfdc7128dbab0ce26639a546c92cb_2" ; "getS#ArcA#instance.a6d142da8215d5903690f8a054289ac7_1" [label="1: Start ArcA.getS\nFormals: self:ArcA*\nLocals: s:NSString* \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/AutoreleaseExample.m.dot b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/AutoreleaseExample.m.dot index a896e5876..3b60653c4 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/AutoreleaseExample.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/AutoreleaseExample.m.dot @@ -127,4 +127,15 @@ digraph cfg { "autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_4" -> "autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_3" ; +"dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_1" [label="1: Start Auto.dealloc\nFormals: self:Auto*\nLocals: \n " color=yellow style=filled] + + + "dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_1" -> "dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_3" ; +"dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_2" [label="2: Exit Auto.dealloc \n " color=yellow style=filled] + + +"dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_3" [label="3: Call dealloc \n n$0=*&self:Auto* [line 25, column 1]\n n$1=*n$0._son:Auto* [line 25, column 1]\n n$2=_fun_Auto.dealloc(n$1:Auto*) [line 25, column 1]\n " shape="box"] + + + "dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_3" -> "dealloc#Auto#instance.f75e3ca5aab8c1f0122d42fc04b27666_2" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m.dot b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m.dot index 4d0441622..4e31c27b9 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m.dot @@ -203,6 +203,17 @@ digraph cfg { "blockFreeNoLeak#MemoryLeakExample#instance.6bcefe2afb9f172f8aadbab54d9bd144_6" -> "blockFreeNoLeak#MemoryLeakExample#instance.6bcefe2afb9f172f8aadbab54d9bd144_5" ; +"dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_1" [label="1: Start MemoryLeakExample.dealloc\nFormals: self:MemoryLeakExample*\nLocals: \n " color=yellow style=filled] + + + "dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_1" -> "dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_3" ; +"dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_2" [label="2: Exit MemoryLeakExample.dealloc \n " color=yellow style=filled] + + +"dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_3" [label="3: Call dealloc \n n$0=*&self:MemoryLeakExample* [line 111, column 1]\n n$1=*n$0._attachmentContainerView:UIView* [line 111, column 1]\n n$2=_fun_UIView.dealloc(n$1:UIView*) [line 111, column 1]\n n$3=*&self:MemoryLeakExample* [line 111, column 1]\n n$4=*n$3._backgroundCoveringView:UIView* [line 111, column 1]\n n$5=_fun_UIView.dealloc(n$4:UIView*) [line 111, column 1]\n " shape="box"] + + + "dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_3" -> "dealloc#MemoryLeakExample#instance.f11793396cace30d3e6f98c00cf65308_2" ; "layoutSubviews#MemoryLeakExample#instance.2b3151f18431bcdbc08267ea4ff96f53_1" [label="1: Start MemoryLeakExample.layoutSubviews\nFormals: self:MemoryLeakExample*\nLocals: shadowPath:CGPath const * attachmentContainerView:UIView* \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/RetainReleaseExample.m.dot b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/RetainReleaseExample.m.dot index 3ce054c6c..1419b8741 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/RetainReleaseExample.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/RetainReleaseExample.m.dot @@ -19,6 +19,17 @@ digraph cfg { "retain_release_test.65a9467f2c991ef519f3b0d97687f937_5" -> "retain_release_test.65a9467f2c991ef519f3b0d97687f937_4" ; +"dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_1" [label="1: Start RRA.dealloc\nFormals: self:RRA*\nLocals: \n " color=yellow style=filled] + + + "dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_1" -> "dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_3" ; +"dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_2" [label="2: Exit RRA.dealloc \n " color=yellow style=filled] + + +"dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_3" -> "dealloc#RRA#instance.6190142b5c653a968806a98372f1f984_2" ; "init#RRA#instance.dca8e0cb72bcdfba262607a28c07b04b_1" [label="1: Start RRA.init\nFormals: self:RRA*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m.dot b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m.dot index ce9d3d45d..eb63daf9c 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m.dot @@ -86,4 +86,15 @@ digraph cfg { "bridgeTransfer#TollBridgeExample#instance.d0065913beb197e891ef0d8a0bb81b38_4" -> "bridgeTransfer#TollBridgeExample#instance.d0065913beb197e891ef0d8a0bb81b38_3" ; +"dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_1" [label="1: Start TollBridgeExample.dealloc\nFormals: self:TollBridgeExample*\nLocals: \n " color=yellow style=filled] + + + "dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_1" -> "dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_3" ; +"dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_2" [label="2: Exit TollBridgeExample.dealloc \n " color=yellow style=filled] + + +"dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_3" -> "dealloc#TollBridgeExample#instance.c883387ebf7fc6e9cfedaafab66aec43_2" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/arc_methods.m.dot b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/arc_methods.m.dot index 1eebecf62..5dcb13d41 100644 --- a/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/arc_methods.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/memory_leaks_benchmark/arc_methods.m.dot @@ -57,4 +57,15 @@ digraph cfg { "someA#ArcMethodsA#class.b84b222a4d332a9b8f3f1d6626af9c8f_4" -> "someA#ArcMethodsA#class.b84b222a4d332a9b8f3f1d6626af9c8f_3" ; +"dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_1" [label="1: Start ArcMethodsA.dealloc\nFormals: self:ArcMethodsA*\nLocals: \n " color=yellow style=filled] + + + "dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_1" -> "dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_3" ; +"dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_2" [label="2: Exit ArcMethodsA.dealloc \n " color=yellow style=filled] + + +"dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_3" -> "dealloc#ArcMethodsA#instance.7ca05d78a1bcb0ca5ca59211927eef83_2" ; } diff --git a/infer/tests/codetoanalyze/objc/shared/npe/Available_expr.m.dot b/infer/tests/codetoanalyze/objc/shared/npe/Available_expr.m.dot index 140741f6a..860ac8101 100644 --- a/infer/tests/codetoanalyze/objc/shared/npe/Available_expr.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/npe/Available_expr.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_1" [label="1: Start Available_expr.dealloc\nFormals: self:Available_expr*\nLocals: \n " color=yellow style=filled] + + + "dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_1" -> "dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_3" ; +"dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_2" [label="2: Exit Available_expr.dealloc \n " color=yellow style=filled] + + +"dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_3" -> "dealloc#Available_expr#instance.091f6c131a219839e0881eafb90a9c30_2" ; "test_no_bug#Available_expr#instance.a4aa786abeb2b17541abfe8ecf02c88f_1" [label="1: Start Available_expr.test_no_bug\nFormals: self:Available_expr*\nLocals: p:int* \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/npe/Nonnull_attribute_example.m.dot b/infer/tests/codetoanalyze/objc/shared/npe/Nonnull_attribute_example.m.dot index e9e61c570..cf848d5b1 100644 --- a/infer/tests/codetoanalyze/objc/shared/npe/Nonnull_attribute_example.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/npe/Nonnull_attribute_example.m.dot @@ -11,6 +11,17 @@ digraph cfg { "NonnullAtrributeTest.69a49728cf7d46ab0add381e5c93704c_3" -> "NonnullAtrributeTest.69a49728cf7d46ab0add381e5c93704c_2" ; +"dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_1" [label="1: Start NonnullA.dealloc\nFormals: self:NonnullA*\nLocals: \n " color=yellow style=filled] + + + "dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_1" -> "dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_3" ; +"dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_2" [label="2: Exit NonnullA.dealloc \n " color=yellow style=filled] + + +"dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_3" -> "dealloc#NonnullA#instance.ab64b440b6de9bb3d108ab73ec461d09_2" ; "getA#NonnullA#instance.d4b29ece551a370c3f0c0c12526b3def_1" [label="1: Start NonnullA.getA\nFormals: self:NonnullA*\nLocals: \n " color=yellow style=filled] @@ -22,6 +33,17 @@ digraph cfg { "getA#NonnullA#instance.d4b29ece551a370c3f0c0c12526b3def_3" -> "getA#NonnullA#instance.d4b29ece551a370c3f0c0c12526b3def_2" ; +"dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_1" [label="1: Start NonnullC.dealloc\nFormals: self:NonnullC*\nLocals: \n " color=yellow style=filled] + + + "dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_1" -> "dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_3" ; +"dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_2" [label="2: Exit NonnullC.dealloc \n " color=yellow style=filled] + + +"dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_3" [label="3: Call dealloc \n n$0=*&self:NonnullC* [line 42, column 1]\n n$1=*n$0._name:NSString* [line 42, column 1]\n n$2=_fun_NSString.dealloc(n$1:NSString*) [line 42, column 1]\n " shape="box"] + + + "dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_3" -> "dealloc#NonnullC#instance.a35e7cd71ed482b37e513a9c2a2e24d8_2" ; "initWithCoder:and:#NonnullC(class NSString,class NonnullA)#instance.e23828ce4467c2001440771e2c4692f8_1" [label="1: Start NonnullC.initWithCoder:and:\nFormals: self:NonnullC* aDecoder:NSString* a:NonnullA*\nLocals: y:int a1:NonnullA*\nAnnotation: <> NonnullC.initWithCoder:and:(<> <> <_Nonnull>) \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/npe/npe_malloc.m.dot b/infer/tests/codetoanalyze/objc/shared/npe/npe_malloc.m.dot index b3f5c6d30..bc9ccb33c 100644 --- a/infer/tests/codetoanalyze/objc/shared/npe/npe_malloc.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/npe/npe_malloc.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_1" [label="1: Start NpeMallocC.dealloc\nFormals: self:NpeMallocC*\nLocals: \n " color=yellow style=filled] + + + "dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_1" -> "dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_3" ; +"dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_2" [label="2: Exit NpeMallocC.dealloc \n " color=yellow style=filled] + + +"dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_3" -> "dealloc#NpeMallocC#instance.284c29ca815697ec1f10b1449c2b53cc_2" ; "test#NpeMallocC#instance.736ba93f935cc64d6e9c549cc16c07a7_1" [label="1: Start NpeMallocC.test\nFormals: self:NpeMallocC*\nLocals: person:Person* \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot b/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot index c46df3a1c..68b6adad5 100644 --- a/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot @@ -63,6 +63,17 @@ digraph cfg { "copy#PropertyA#instance.d5955e11cf35af4b4d602b2971590d5f_10" -> "copy#PropertyA#instance.d5955e11cf35af4b4d602b2971590d5f_5" ; "copy#PropertyA#instance.d5955e11cf35af4b4d602b2971590d5f_10" -> "copy#PropertyA#instance.d5955e11cf35af4b4d602b2971590d5f_6" ; +"dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_1" [label="1: Start PropertyA.dealloc\nFormals: self:PropertyA*\nLocals: \n " color=yellow style=filled] + + + "dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_1" -> "dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_3" ; +"dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_2" [label="2: Exit PropertyA.dealloc \n " color=yellow style=filled] + + +"dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_3" [label="3: Call dealloc \n n$0=*&self:PropertyA* [line 38, column 1]\n n$1=*n$0._last_name:PropertyA* [line 38, column 1]\n n$2=_fun_PropertyA.dealloc(n$1:PropertyA*) [line 38, column 1]\n n$3=*&self:PropertyA* [line 38, column 1]\n n$4=*n$3._name:PropertyA* [line 38, column 1]\n n$5=_fun_PropertyA.dealloc(n$4:PropertyA*) [line 38, column 1]\n n$6=*&self:PropertyA* [line 38, column 1]\n n$7=*n$6._child:PropertyA* [line 38, column 1]\n n$8=_fun_PropertyA.dealloc(n$7:PropertyA*) [line 38, column 1]\n " shape="box"] + + + "dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_3" -> "dealloc#PropertyA#instance.6f8be74d1c8a16eeeed561e5def4ae54_2" ; "init#PropertyA#instance.a50cf011b0759e26f65bb059fbc6d60c_1" [label="1: Start PropertyA.init\nFormals: self:PropertyA*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/Bicycle.m.dot b/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/Bicycle.m.dot index da037e192..d524a13ce 100644 --- a/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/Bicycle.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/Bicycle.m.dot @@ -1,5 +1,16 @@ /* @generated */ digraph cfg { +"dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_1" [label="1: Start Bicycle.dealloc\nFormals: self:Bicycle*\nLocals: \n " color=yellow style=filled] + + + "dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_1" -> "dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_3" ; +"dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_2" [label="2: Exit Bicycle.dealloc \n " color=yellow style=filled] + + +"dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_3" [label="3: Call dealloc \n " shape="box"] + + + "dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_3" -> "dealloc#Bicycle#instance.6638bb9309381e06250999580487aff7_2" ; "lockToStructure:#Bicycle(struct objc_object)#instance.08c84c9f07aafb2f30ed48101344ca7a_1" [label="1: Start Bicycle.lockToStructure:\nFormals: self:Bicycle* theStructure:objc_object*\nLocals: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/uninit/issues.exp b/infer/tests/codetoanalyze/objc/uninit/issues.exp index e5955ca6d..6ba1d524f 100644 --- a/infer/tests/codetoanalyze/objc/uninit/issues.exp +++ b/infer/tests/codetoanalyze/objc/uninit/issues.exp @@ -2,4 +2,4 @@ codetoanalyze/objc/uninit/arrays.m, array_length_undef_bad, 2, UNINITIALIZED_VAL codetoanalyze/objc/uninit/arrays.m, bad1, 3, UNINITIALIZED_VALUE, no_bucket, ERROR, [] codetoanalyze/objc/uninit/arrays.m, bad2, 2, UNINITIALIZED_VALUE, no_bucket, ERROR, [] codetoanalyze/objc/uninit/uninit.m, FP_switch_ok, 11, UNINITIALIZED_VALUE, no_bucket, ERROR, [] -codetoanalyze/objc/uninit/uninit_blocks.m, A.bad1, 5, UNINITIALIZED_VALUE, no_bucket, ERROR, [] +codetoanalyze/objc/uninit/uninit_blocks.m, UninitBlocks.bad1, 5, UNINITIALIZED_VALUE, no_bucket, ERROR, [] diff --git a/infer/tests/codetoanalyze/objc/uninit/uninit_blocks.m b/infer/tests/codetoanalyze/objc/uninit/uninit_blocks.m index 556fa6ea6..7f7036e18 100644 --- a/infer/tests/codetoanalyze/objc/uninit/uninit_blocks.m +++ b/infer/tests/codetoanalyze/objc/uninit/uninit_blocks.m @@ -6,7 +6,7 @@ */ #import -@interface A : NSObject +@interface UninitBlocks : NSObject @end typedef void (^MyBlock)(); @@ -17,7 +17,7 @@ typedef void (^MyBlock)(); @end -@implementation A +@implementation UninitBlocks + (int)ok1 { __block int a; diff --git a/infer/tests/codetoanalyze/objcpp/biabduction/c_functions.mm b/infer/tests/codetoanalyze/objcpp/biabduction/c_functions.mm index 3670d07a5..a383c934a 100644 --- a/infer/tests/codetoanalyze/objcpp/biabduction/c_functions.mm +++ b/infer/tests/codetoanalyze/objcpp/biabduction/c_functions.mm @@ -6,14 +6,14 @@ */ #import -@interface A : NSObject +@interface Functions : NSObject @property(strong) void (^block)(void); @end -@implementation A +@implementation Functions + (instancetype)autoUpdating { - static A* a; + static Functions* a; dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ a = [self alloc]; @@ -25,7 +25,7 @@ static void dispatch_once2(dispatch_once_t* predicate, dispatch_block_t block); + (instancetype)autoUpdating2 { - static A* a; + static Functions* a; dispatch_once_t onceToken; dispatch_once2(&onceToken, ^{ a = [self alloc]; @@ -38,8 +38,8 @@ static void dispatch_once2(dispatch_once_t* predicate, dispatch_block_t block); @end int main() { - A* a = [A autoUpdating]; - A* a2 = [A autoUpdating2]; + Functions* a = [Functions autoUpdating]; + Functions* a2 = [Functions autoUpdating2]; a.block(); a2.block(); // NPE here since dispatch_once2 is skipped } diff --git a/infer/tests/codetoanalyze/objcpp/biabduction/issues.exp b/infer/tests/codetoanalyze/objcpp/biabduction/issues.exp index 7f30b6877..d2348f8ee 100644 --- a/infer/tests/codetoanalyze/objcpp/biabduction/issues.exp +++ b/infer/tests/codetoanalyze/objcpp/biabduction/issues.exp @@ -1,6 +1,6 @@ codetoanalyze/objcpp/biabduction/BlockLfield.mm, A.mOk, 1, PRECONDITION_NOT_FOUND, no_bucket, ERROR, [start of procedure mOk] codetoanalyze/objcpp/biabduction/BlockLfield.mm, CFunWithBlockOk, 2, PRECONDITION_NOT_MET, no_bucket, WARNING, [start of procedure CFunWithBlockOk()] codetoanalyze/objcpp/biabduction/BlockLfield.mm, CFunWithBlockOk_objc_blockA.mOk_1, 2, PRECONDITION_NOT_MET, no_bucket, WARNING, [start of procedure CFunWithBlockOk()] -codetoanalyze/objcpp/biabduction/c_functions.mm, main, 4, NULL_DEREFERENCE, B5, ERROR, [start of procedure main(),start of procedure autoUpdating,return from a call to A.autoUpdating,start of procedure autoUpdating2,Skipping dispatch_once2(): method has no implementation,return from a call to A.autoUpdating2,Executing synthesized getter block,start of procedure block,return from a call to objc_blockobjc_blockA.autoUpdating_1_2,Message block with receiver nil returns nil.] +codetoanalyze/objcpp/biabduction/c_functions.mm, main, 4, NULL_DEREFERENCE, B5, ERROR, [start of procedure main(),start of procedure autoUpdating,return from a call to Functions.autoUpdating,start of procedure autoUpdating2,Skipping dispatch_once2(): method has no implementation,return from a call to Functions.autoUpdating2,Executing synthesized getter block,start of procedure block,return from a call to objc_blockobjc_blockFunctions.autoUpdating_1_2,Message block with receiver nil returns nil.] codetoanalyze/objcpp/biabduction/retain_cycles/RetainCycleWithStruct.mm, Animation.tracer, 2, BIABDUCTION_ANALYSIS_STOPS, no_bucket, WARNING, [start of procedure tracer,start of procedure _State,return from a call to _State::_State,start of procedure initWithAnimation:,Taking true branch,return from a call to Tracer.initWithAnimation:] codetoanalyze/objcpp/biabduction/retain_cycles/RetainCycleWithStruct.mm, Animation.tracer, 2, RETAIN_CYCLE, no_bucket, ERROR, [start of procedure tracer,start of procedure _State,return from a call to _State::_State,start of procedure initWithAnimation:,Taking true branch,return from a call to Tracer.initWithAnimation:]