From 71cf1760c506644932e01b0e9e5b4b98b6a21691 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Fri, 15 Dec 2017 09:34:34 -0800 Subject: [PATCH] [infer][nullable checker] find the nullable violation involving annotated protocol methods Summary: Before this diff, the nullable checker would not be able to find annotations involving methods annotated in the protocols update-submodule: facebook-clang-plugins Reviewed By: sblackshear Differential Revision: D6534893 fbshipit-source-id: 39bd3dd --- facebook-clang-plugins | 2 +- infer/src/clang/cMethod_trans.ml | 28 +++++++++---------- .../codetoanalyze/objc/checkers/Nullable.m | 9 ++++++ .../codetoanalyze/objc/checkers/issues.exp | 3 ++ .../objc/frontend/block/static.m.dot | 6 ++-- .../exceptions/ExceptionExample.m.dot | 2 +- .../objc/frontend/protocol/protocol.m.dot | 2 +- .../objc/frontend/self_static/Self.m.dot | 4 +-- .../objc/shared/block/dispatch.m.dot | 8 +++--- .../AutoreleaseExample.m.dot | 10 +++---- .../MemoryLeakExample.m.dot | 2 +- .../RetainReleaseExample.m.dot | 4 +-- .../shared/property/PropertyAttributes.m.dot | 2 +- .../objc/shared/protocol_procdesc/main.c.dot | 2 +- 14 files changed, 48 insertions(+), 36 deletions(-) diff --git a/facebook-clang-plugins b/facebook-clang-plugins index ac0bceaa0..bda48308b 160000 --- a/facebook-clang-plugins +++ b/facebook-clang-plugins @@ -1 +1 @@ -Subproject commit ac0bceaa019efded13109c192a2f955f476e2b27 +Subproject commit bda48308b880a006a36fb0576b0245d781e88625 diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index 896c53dfa..3c8037d70 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -242,18 +242,17 @@ let get_method_name_from_clang tenv ms_opt = match ms_opt with | Some ms -> ( match CAst_utils.get_decl_opt (CMethod_signature.ms_get_pointer_to_parent ms) with - | Some decl -> - if ObjcProtocol_decl.is_protocol decl then None - else ( - ignore (CType_decl.add_types_from_decl_to_tenv tenv decl) ; - match ObjcCategory_decl.get_base_class_name_from_category decl with - | Some class_typename -> - let procname = CMethod_signature.ms_get_name ms in - let new_procname = Typ.Procname.replace_class procname class_typename in - CMethod_signature.ms_set_name ms new_procname ; - Some ms - | None -> - Some ms ) + | Some decl + -> ( + ignore (CType_decl.add_types_from_decl_to_tenv tenv decl) ; + match ObjcCategory_decl.get_base_class_name_from_category decl with + | Some class_typename -> + let procname = CMethod_signature.ms_get_name ms in + let new_procname = Typ.Procname.replace_class procname class_typename in + CMethod_signature.ms_set_name ms new_procname ; + Some ms + | None -> + Some ms ) | None -> Some ms ) | None -> @@ -620,13 +619,13 @@ let create_local_procdesc ?(set_objc_accessor_attr= false) trans_unit_ctx cfg te in Cfg.create_proc_desc cfg proc_attributes in - if defined then ( + if defined then let start_kind = Procdesc.Node.Start_node proc_name in let start_node = Procdesc.create_node procdesc loc_start start_kind [] in let exit_kind = Procdesc.Node.Exit_node proc_name in let exit_node = Procdesc.create_node procdesc loc_exit exit_kind [] in Procdesc.set_start_node procdesc start_node ; - Procdesc.set_exit_node procdesc exit_node ) + Procdesc.set_exit_node procdesc exit_node in if should_create_procdesc cfg proc_name defined set_objc_accessor_attr then ( create_new_procdesc () ; true ) @@ -693,3 +692,4 @@ let get_captures_from_cpp_lambda dec = cxx_rdi.xrdi_lambda_captures | _ -> assert false + diff --git a/infer/tests/codetoanalyze/objc/checkers/Nullable.m b/infer/tests/codetoanalyze/objc/checkers/Nullable.m index 2d4d52092..733d3d48c 100644 --- a/infer/tests/codetoanalyze/objc/checkers/Nullable.m +++ b/infer/tests/codetoanalyze/objc/checkers/Nullable.m @@ -217,3 +217,12 @@ int* __nullable returnsNull(); } @end + +@protocol P +- (NSObject* _Nullable)nullableMethod; +@end + +NSDictionary* callNullableMethodFromProtocolBad(id

pObject) { + NSObject* nullableObject = [pObject nullableMethod]; + return @{@"key" : nullableObject}; +} diff --git a/infer/tests/codetoanalyze/objc/checkers/issues.exp b/infer/tests/codetoanalyze/objc/checkers/issues.exp index 94a18b848..5d2455986 100644 --- a/infer/tests/codetoanalyze/objc/checkers/issues.exp +++ b/infer/tests/codetoanalyze/objc/checkers/issues.exp @@ -38,4 +38,7 @@ codetoanalyze/objc/checkers/Nullable.m, T_setNullableObjectInDictionaryBad, 2, N codetoanalyze/objc/checkers/Nullable.m, T_setNullableObjectInDictionaryBad, 2, NULL_DEREFERENCE, [start of procedure setNullableObjectInDictionaryBad,start of procedure nullableMethod,return from a call to T_nullableMethod] codetoanalyze/objc/checkers/Nullable.m, T_testNonnullFieldForNullBad, 1, FIELD_SHOULD_BE_NULLABLE, [Field nonnullField is compared to null here] codetoanalyze/objc/checkers/Nullable.m, T_testUnnanotatedFieldForNullBad, 1, FIELD_SHOULD_BE_NULLABLE, [Field unnanotatedField is compared to null here] +codetoanalyze/objc/checkers/Nullable.m, callNullableMethodFromProtocolBad, 2, NULLABLE_DEREFERENCE, [dereference of &nullableObject,assignment of the nullable value,definition of nullableMethod] +codetoanalyze/objc/checkers/Nullable.m, callNullableMethodFromProtocolBad, 2, NULL_DEREFERENCE, [start of procedure callNullableMethodFromProtocolBad(),Skipping nullableMethod: function or method not found] +codetoanalyze/objc/checkers/Nullable.m, callNullableMethodFromProtocolBad, 2, PARAMETER_NOT_NULL_CHECKED, [start of procedure callNullableMethodFromProtocolBad(),Message nullableMethod with receiver nil returns nil.] codetoanalyze/objc/checkers/Nullable.m, objc_blockT_DeadStoreFP_testUnnanotatedFieldInClosureBad_1, 1, FIELD_SHOULD_BE_NULLABLE, [Field unnanotatedField is compared to null here] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot b/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot index 2992d0a17..6c8ff886f 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/static.m.dot @@ -22,7 +22,7 @@ digraph iCFG { "objc_blockA_test_1.91b00d7c265c98d7bfda34cc42ad73ed_2" [label="2: Exit objc_blockA_test_1 \n " color=yellow style=filled] -"objc_blockA_test_1.91b00d7c265c98d7bfda34cc42ad73ed_3" [label="3: BinaryOperatorStmt: Assign \n n$1=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 21, column 23]\n n$2=_fun_A_init(n$1:A*) virtual [line 21, column 22]\n *&#GB$A_test_sharedInstance:objc_object*=n$2 [line 21, column 5]\n " shape="box"] +"objc_blockA_test_1.91b00d7c265c98d7bfda34cc42ad73ed_3" [label="3: BinaryOperatorStmt: Assign \n n$1=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 21, column 23]\n n$2=_fun_NSBundleResourceRequest_init(n$1:A*) virtual [line 21, column 22]\n *&#GB$A_test_sharedInstance:objc_object*=n$2 [line 21, column 5]\n " shape="box"] "objc_blockA_test_1.91b00d7c265c98d7bfda34cc42ad73ed_3" -> "objc_blockA_test_1.91b00d7c265c98d7bfda34cc42ad73ed_2" ; @@ -44,7 +44,7 @@ digraph iCFG { "objc_blockA_test_leak_2.5b3de3f9ef0695311853bace3ed320b8_2" [label="2: Exit objc_blockA_test_leak_2 \n " color=yellow style=filled] -"objc_blockA_test_leak_2.5b3de3f9ef0695311853bace3ed320b8_3" [label="3: BinaryOperatorStmt: Assign \n n$3=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 31, column 23]\n n$4=_fun_A_init(n$3:A*) virtual [line 31, column 22]\n *&#GB$A_test_leak_sharedInstance:objc_object*=n$4 [line 31, column 5]\n " shape="box"] +"objc_blockA_test_leak_2.5b3de3f9ef0695311853bace3ed320b8_3" [label="3: BinaryOperatorStmt: Assign \n n$3=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 31, column 23]\n n$4=_fun_NSBundleResourceRequest_init(n$3:A*) virtual [line 31, column 22]\n *&#GB$A_test_leak_sharedInstance:objc_object*=n$4 [line 31, column 5]\n " shape="box"] "objc_blockA_test_leak_2.5b3de3f9ef0695311853bace3ed320b8_3" -> "objc_blockA_test_leak_2.5b3de3f9ef0695311853bace3ed320b8_2" ; @@ -63,7 +63,7 @@ digraph iCFG { "test2#A#class.ce50cb13c3345decc567dd4eb6124604_4" -> "test2#A#class.ce50cb13c3345decc567dd4eb6124604_3" ; -"test2#A#class.ce50cb13c3345decc567dd4eb6124604_5" [label="5: BinaryOperatorStmt: Assign \n n$7=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 38, column 21]\n n$8=_fun_A_init(n$7:A*) virtual [line 38, column 20]\n *&#GB$A_test2_sharedInstance:objc_object*=n$8 [line 38, column 3]\n " shape="box"] +"test2#A#class.ce50cb13c3345decc567dd4eb6124604_5" [label="5: BinaryOperatorStmt: Assign \n n$7=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 38, column 21]\n n$8=_fun_NSBundleResourceRequest_init(n$7:A*) virtual [line 38, column 20]\n *&#GB$A_test2_sharedInstance:objc_object*=n$8 [line 38, column 3]\n " shape="box"] "test2#A#class.ce50cb13c3345decc567dd4eb6124604_5" -> "test2#A#class.ce50cb13c3345decc567dd4eb6124604_4" ; diff --git a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot index 1b2c0ef33..7b60e7d50 100644 --- a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.m.dot @@ -7,7 +7,7 @@ digraph iCFG { "test#ExceptionExample#instance.513cde8d794322493646dbd1821516dd_2" [label="2: Exit ExceptionExample_test \n " color=yellow style=filled] -"test#ExceptionExample#instance.513cde8d794322493646dbd1821516dd_3" [label="3: Message Call: description \n n$0=*&self:ExceptionExample* [line 23, column 6]\n n$1=_fun_ExceptionExample_description(n$0:ExceptionExample*) [line 23, column 5]\n " shape="box"] +"test#ExceptionExample#instance.513cde8d794322493646dbd1821516dd_3" [label="3: Message Call: description \n n$0=*&self:ExceptionExample* [line 23, column 6]\n n$1=_fun_NSObject_description(n$0:ExceptionExample*) [line 23, column 5]\n " shape="box"] "test#ExceptionExample#instance.513cde8d794322493646dbd1821516dd_3" -> "test#ExceptionExample#instance.513cde8d794322493646dbd1821516dd_2" ; diff --git a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot index 872e8afa0..12d5e85ac 100644 --- a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.m.dot @@ -15,7 +15,7 @@ digraph iCFG { "fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_4" -> "fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_2" ; -"fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_5" [label="5: Message Call: conformsToProtocol: \n n$0=*&self:Bla* [line 25, column 8]\n n$1=_fun_Bla_conformsToProtocol:(n$0:Bla*,\"Foo\":Protocol*) virtual [line 25, column 7]\n " shape="box"] +"fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_5" [label="5: Message Call: conformsToProtocol: \n n$0=*&self:Bla* [line 25, column 8]\n n$1=_fun_NSObject_conformsToProtocol:(n$0:Bla*,\"Foo\":Protocol*) virtual [line 25, column 7]\n " shape="box"] "fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_5" -> "fooMethod#Bla#instance.d982e99c073f2d30dc24c41bb29add6a_6" ; 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 7bc656233..62b3bff52 100644 --- a/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/self_static/Self.m.dot @@ -21,7 +21,7 @@ digraph iCFG { "call_test_class#A#class.cc4e8c6ada1c4f85dad976d179e36c9a_2" [label="2: Exit A_call_test_class \n " color=yellow style=filled] -"call_test_class#A#class.cc4e8c6ada1c4f85dad976d179e36c9a_3" [label="3: Message Call: test_class \n _fun_A_test_class() [line 54, column 3]\n " shape="box"] +"call_test_class#A#class.cc4e8c6ada1c4f85dad976d179e36c9a_3" [label="3: Message Call: test_class \n _fun_C_test_class() [line 54, column 3]\n " shape="box"] "call_test_class#A#class.cc4e8c6ada1c4f85dad976d179e36c9a_3" -> "call_test_class#A#class.cc4e8c6ada1c4f85dad976d179e36c9a_2" ; @@ -119,7 +119,7 @@ digraph iCFG { "call_class_instance#A#instance.eb1ae02cd94582eb1fc7cb426794f9f0_2" [label="2: Exit A_call_class_instance \n " color=yellow style=filled] -"call_class_instance#A#instance.eb1ae02cd94582eb1fc7cb426794f9f0_3" [label="3: Message Call: test_class \n _fun_A_test_class() [line 66, column 3]\n " shape="box"] +"call_class_instance#A#instance.eb1ae02cd94582eb1fc7cb426794f9f0_3" [label="3: Message Call: test_class \n _fun_C_test_class() [line 66, column 3]\n " shape="box"] "call_class_instance#A#instance.eb1ae02cd94582eb1fc7cb426794f9f0_3" -> "call_class_instance#A#instance.eb1ae02cd94582eb1fc7cb426794f9f0_2" ; diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot index 98b381cfd..3ef4d7666 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot @@ -22,7 +22,7 @@ digraph iCFG { "objc_blockDispatchA_sharedInstance_1.0b8803e75b6a82e1a4530bcb953490e2_2" [label="2: Exit objc_blockDispatchA_sharedInstance_1 \n " color=yellow style=filled] -"objc_blockDispatchA_sharedInstance_1.0b8803e75b6a82e1a4530bcb953490e2_3" [label="3: BinaryOperatorStmt: Assign \n n$2=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 31, column 23]\n n$3=_fun_DispatchA_init(n$2:DispatchA*) virtual [line 31, column 22]\n *&#GB$DispatchA_sharedInstance_sharedInstance:objc_object*=n$3 [line 31, column 5]\n " shape="box"] +"objc_blockDispatchA_sharedInstance_1.0b8803e75b6a82e1a4530bcb953490e2_3" [label="3: BinaryOperatorStmt: Assign \n n$2=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 31, column 23]\n n$3=_fun_NSBundleResourceRequest_init(n$2:DispatchA*) virtual [line 31, column 22]\n *&#GB$DispatchA_sharedInstance_sharedInstance:objc_object*=n$3 [line 31, column 5]\n " shape="box"] "objc_blockDispatchA_sharedInstance_1.0b8803e75b6a82e1a4530bcb953490e2_3" -> "objc_blockDispatchA_sharedInstance_1.0b8803e75b6a82e1a4530bcb953490e2_2" ; @@ -71,7 +71,7 @@ digraph iCFG { "objc_blockDispatchA_trans_3.80c09fe69dc0d5591de63a0c525de29b_2" [label="2: Exit objc_blockDispatchA_trans_3 \n " color=yellow style=filled] -"objc_blockDispatchA_trans_3.80c09fe69dc0d5591de63a0c525de29b_3" [label="3: BinaryOperatorStmt: Assign \n n$12=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 48, column 23]\n n$13=_fun_DispatchA_init(n$12:DispatchA*) virtual [line 48, column 22]\n *&#GB$DispatchA_trans_sharedInstance:objc_object*=n$13 [line 48, column 5]\n " shape="box"] +"objc_blockDispatchA_trans_3.80c09fe69dc0d5591de63a0c525de29b_3" [label="3: BinaryOperatorStmt: Assign \n n$12=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 48, column 23]\n n$13=_fun_NSBundleResourceRequest_init(n$12:DispatchA*) virtual [line 48, column 22]\n *&#GB$DispatchA_trans_sharedInstance:objc_object*=n$13 [line 48, column 5]\n " shape="box"] "objc_blockDispatchA_trans_3.80c09fe69dc0d5591de63a0c525de29b_3" -> "objc_blockDispatchA_trans_3.80c09fe69dc0d5591de63a0c525de29b_2" ; @@ -101,7 +101,7 @@ digraph iCFG { "objc_blockDispatchA_dispatch_a_block_variable_4.2eedc45fca2c35e6e8c11937ba7a2df8_2" [label="2: Exit objc_blockDispatchA_dispatch_a_block_variable_4 \n " color=yellow style=filled] -"objc_blockDispatchA_dispatch_a_block_variable_4.2eedc45fca2c35e6e8c11937ba7a2df8_3" [label="3: BinaryOperatorStmt: Assign \n n$16=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 57, column 25]\n n$17=_fun_DispatchA_init(n$16:DispatchA*) virtual [line 57, column 25]\n *&#GB$DispatchA_dispatch_a_block_variable_static_storage__:objc_object*=n$17 [line 57, column 5]\n " shape="box"] +"objc_blockDispatchA_dispatch_a_block_variable_4.2eedc45fca2c35e6e8c11937ba7a2df8_3" [label="3: BinaryOperatorStmt: Assign \n n$16=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 57, column 25]\n n$17=_fun_NSObject_init(n$16:DispatchA*) virtual [line 57, column 25]\n *&#GB$DispatchA_dispatch_a_block_variable_static_storage__:objc_object*=n$17 [line 57, column 5]\n " shape="box"] "objc_blockDispatchA_dispatch_a_block_variable_4.2eedc45fca2c35e6e8c11937ba7a2df8_3" -> "objc_blockDispatchA_dispatch_a_block_variable_4.2eedc45fca2c35e6e8c11937ba7a2df8_2" ; @@ -135,7 +135,7 @@ digraph iCFG { "objc_blockDispatchA_dispatch_a_block_variable_from_macro_5.e4f37df69df9d95138cb008e85eedab8_2" [label="2: Exit objc_blockDispatchA_dispatch_a_block_variable_from_macro_5 \n " color=yellow style=filled] -"objc_blockDispatchA_dispatch_a_block_variable_from_macro_5.e4f37df69df9d95138cb008e85eedab8_3" [label="3: BinaryOperatorStmt: Assign \n n$20=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 68, column 27]\n n$21=_fun_DispatchA_init(n$20:DispatchA*) virtual [line 68, column 27]\n *&#GB$DispatchA_dispatch_a_block_variable_from_macro_static_storage__:objc_object*=n$21 [line 68, column 7]\n " shape="box"] +"objc_blockDispatchA_dispatch_a_block_variable_from_macro_5.e4f37df69df9d95138cb008e85eedab8_3" [label="3: BinaryOperatorStmt: Assign \n n$20=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 68, column 27]\n n$21=_fun_NSObject_init(n$20:DispatchA*) virtual [line 68, column 27]\n *&#GB$DispatchA_dispatch_a_block_variable_from_macro_static_storage__:objc_object*=n$21 [line 68, column 7]\n " shape="box"] "objc_blockDispatchA_dispatch_a_block_variable_from_macro_5.e4f37df69df9d95138cb008e85eedab8_3" -> "objc_blockDispatchA_dispatch_a_block_variable_from_macro_5.e4f37df69df9d95138cb008e85eedab8_2" ; 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 d32d05ce8..668dfdd8c 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 @@ -7,7 +7,7 @@ digraph iCFG { "createA.48a5d7f480131d59bba69d521715b836_2" [label="2: Exit createA \n " color=yellow style=filled] -"createA.48a5d7f480131d59bba69d521715b836_3" [label="3: Return Stmt \n n$0=*&s1:Auto* [line 31, column 11]\n n$1=_fun_Auto_autorelease(n$0:Auto*) virtual [line 31, column 10]\n *&return:Auto*=n$1 [line 31, column 3]\n " shape="box"] +"createA.48a5d7f480131d59bba69d521715b836_3" [label="3: Return Stmt \n n$0=*&s1:Auto* [line 31, column 11]\n n$1=_fun_NSObject_autorelease(n$0:Auto*) virtual [line 31, column 10]\n *&return:Auto*=n$1 [line 31, column 3]\n " shape="box"] "createA.48a5d7f480131d59bba69d521715b836_3" -> "createA.48a5d7f480131d59bba69d521715b836_2" ; @@ -34,7 +34,7 @@ digraph iCFG { "autorelease_test1.8f3499e28c7129f0f6b2300d214d7864_5" -> "autorelease_test1.8f3499e28c7129f0f6b2300d214d7864_4" ; -"autorelease_test1.8f3499e28c7129f0f6b2300d214d7864_6" [label="6: Message Call: retain \n n$2=*&s1:Auto* [line 40, column 6]\n n$3=_fun_Auto_retain(n$2:Auto*) virtual [line 40, column 5]\n " shape="box"] +"autorelease_test1.8f3499e28c7129f0f6b2300d214d7864_6" [label="6: Message Call: retain \n n$2=*&s1:Auto* [line 40, column 6]\n n$3=_fun_NSObject_retain(n$2:Auto*) virtual [line 40, column 5]\n " shape="box"] "autorelease_test1.8f3499e28c7129f0f6b2300d214d7864_6" -> "autorelease_test1.8f3499e28c7129f0f6b2300d214d7864_5" ; @@ -100,11 +100,11 @@ digraph iCFG { "autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_3" -> "autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_2" ; -"autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_4" [label="4: Message Call: release \n n$1=*&pool:NSAutoreleasePool* [line 63, column 4]\n _fun_NSAutoreleasePool_release(n$1:NSAutoreleasePool*) virtual [line 63, column 3]\n " shape="box"] +"autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_4" [label="4: Message Call: release \n n$1=*&pool:NSAutoreleasePool* [line 63, column 4]\n _fun_NSObject_release(n$1:NSAutoreleasePool*) virtual [line 63, column 3]\n " shape="box"] "autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_4" -> "autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_3" ; -"autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_5" [label="5: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(t=NSString):unsigned long) [line 61, column 23]\n n$3=_fun_NSString_autorelease(n$2:NSString*) virtual [line 61, column 22]\n *&string:NSString*=n$3 [line 61, column 3]\n " shape="box"] +"autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_5" [label="5: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(t=NSString):unsigned long) [line 61, column 23]\n n$3=_fun_NSObject_autorelease(n$2:NSString*) virtual [line 61, column 22]\n *&string:NSString*=n$3 [line 61, column 3]\n " shape="box"] "autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_5" -> "autorelease_test3.5fa2e6ceb6075e26a47f9b8c9cdf65ba_4" ; @@ -119,7 +119,7 @@ digraph iCFG { "autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_2" [label="2: Exit Auto_autorelease_main \n " color=yellow style=filled] -"autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_3" [label="3: Return Stmt \n n$0=*&s:NSString* [line 24, column 11]\n n$1=_fun_NSString_autorelease(n$0:NSString*) virtual [line 24, column 10]\n *&return:NSString*=n$1 [line 24, column 3]\n " shape="box"] +"autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_3" [label="3: Return Stmt \n n$0=*&s:NSString* [line 24, column 11]\n n$1=_fun_NSObject_autorelease(n$0:NSString*) virtual [line 24, column 10]\n *&return:NSString*=n$1 [line 24, column 3]\n " shape="box"] "autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_3" -> "autorelease_main#Auto#instance.dbdd003a511fe2beb7e0a817d39f6fd8_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 b6ca081da..7e980b115 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 @@ -112,7 +112,7 @@ digraph iCFG { "layoutSubviews#MemoryLeakExample#instance.2b3151f18431bcdbc08267ea4ff96f53_2" [label="2: Exit MemoryLeakExample_layoutSubviews \n " color=yellow style=filled] -"layoutSubviews#MemoryLeakExample#instance.2b3151f18431bcdbc08267ea4ff96f53_3" [label="3: Message Call: release \n n$0=*&attachmentContainerView:UIView* [line 25, column 4]\n _fun_UIView_release(n$0:UIView*) virtual [line 25, column 3]\n " shape="box"] +"layoutSubviews#MemoryLeakExample#instance.2b3151f18431bcdbc08267ea4ff96f53_3" [label="3: Message Call: release \n n$0=*&attachmentContainerView:UIView* [line 25, column 4]\n _fun_NSObject_release(n$0:UIView*) virtual [line 25, column 3]\n " shape="box"] "layoutSubviews#MemoryLeakExample#instance.2b3151f18431bcdbc08267ea4ff96f53_3" -> "layoutSubviews#MemoryLeakExample#instance.2b3151f18431bcdbc08267ea4ff96f53_2" ; 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 b1b1326fa..79ad168c8 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 @@ -7,11 +7,11 @@ digraph iCFG { "retain_release_test.65a9467f2c991ef519f3b0d97687f937_2" [label="2: Exit retain_release_test \n " color=yellow style=filled] -"retain_release_test.65a9467f2c991ef519f3b0d97687f937_3" [label="3: Message Call: release \n n$0=*&a:RRA* [line 27, column 4]\n _fun_RRA_release(n$0:RRA*) virtual [line 27, column 3]\n " shape="box"] +"retain_release_test.65a9467f2c991ef519f3b0d97687f937_3" [label="3: Message Call: release \n n$0=*&a:RRA* [line 27, column 4]\n _fun_NSObject_release(n$0:RRA*) virtual [line 27, column 3]\n " shape="box"] "retain_release_test.65a9467f2c991ef519f3b0d97687f937_3" -> "retain_release_test.65a9467f2c991ef519f3b0d97687f937_2" ; -"retain_release_test.65a9467f2c991ef519f3b0d97687f937_4" [label="4: Message Call: retain \n n$1=*&a:RRA* [line 26, column 4]\n n$2=_fun_RRA_retain(n$1:RRA*) virtual [line 26, column 3]\n " shape="box"] +"retain_release_test.65a9467f2c991ef519f3b0d97687f937_4" [label="4: Message Call: retain \n n$1=*&a:RRA* [line 26, column 4]\n n$2=_fun_NSObject_retain(n$1:RRA*) virtual [line 26, column 3]\n " shape="box"] "retain_release_test.65a9467f2c991ef519f3b0d97687f937_4" -> "retain_release_test.65a9467f2c991ef519f3b0d97687f937_3" ; diff --git a/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot b/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot index 7147e0a7e..267aa7748 100644 --- a/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/property/PropertyAttributes.m.dot @@ -11,7 +11,7 @@ digraph iCFG { "test.098f6bcd4621d373cade4e832627b4f6_3" -> "test.098f6bcd4621d373cade4e832627b4f6_2" ; -"test.098f6bcd4621d373cade4e832627b4f6_4" [label="4: Message Call: release \n n$0=*&a:PropertyA* [line 45, column 4]\n _fun_PropertyA_release(n$0:PropertyA*) virtual [line 45, column 3]\n " shape="box"] +"test.098f6bcd4621d373cade4e832627b4f6_4" [label="4: Message Call: release \n n$0=*&a:PropertyA* [line 45, column 4]\n _fun_NSObject_release(n$0:PropertyA*) virtual [line 45, column 3]\n " shape="box"] "test.098f6bcd4621d373cade4e832627b4f6_4" -> "test.098f6bcd4621d373cade4e832627b4f6_3" ; diff --git a/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/main.c.dot b/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/main.c.dot index 777da8ef4..229760422 100644 --- a/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/main.c.dot +++ b/infer/tests/codetoanalyze/objc/shared/protocol_procdesc/main.c.dot @@ -11,7 +11,7 @@ digraph iCFG { "ProtocolProcdescMain.84e7d2448aa904c965bf225f17cfb503_3" -> "ProtocolProcdescMain.84e7d2448aa904c965bf225f17cfb503_2" ; -"ProtocolProcdescMain.84e7d2448aa904c965bf225f17cfb503_4" [label="4: Message Call: signalStop \n n$0=*&bike:Bicycle* [line 16, column 4]\n _fun_Bicycle_signalStop(n$0:Bicycle*) virtual [line 16, column 3]\n " shape="box"] +"ProtocolProcdescMain.84e7d2448aa904c965bf225f17cfb503_4" [label="4: Message Call: signalStop \n n$0=*&bike:Bicycle* [line 16, column 4]\n _fun_StreetVehicle_signalStop(n$0:Bicycle*) virtual [line 16, column 3]\n " shape="box"] "ProtocolProcdescMain.84e7d2448aa904c965bf225f17cfb503_4" -> "ProtocolProcdescMain.84e7d2448aa904c965bf225f17cfb503_3" ;