diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index f7dad423e..93d5c857e 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -882,9 +882,7 @@ struct let line_number = CLocation.get_line si parent_line_number in let sil_loc = CLocation.get_sil_location si parent_line_number context in let method_type = CTypes_decl.get_type_from_expr_info expr_info context.CContext.tenv in - let ret_id = - if Sil.typ_equal method_type Sil.Tvoid then [] - else [Ident.create_fresh Ident.knormal] in + let trans_state_pri = PriorityNode.try_claim_priority_node trans_state si in let trans_state_param = { trans_state_pri with parent_line_number = line_number; succ_nodes = [] } in @@ -901,19 +899,25 @@ struct obj_c_message_expr_info res_trans_par in let is_virtual = method_call_type = CMethod_trans.MCVirtual in Cg.add_edge context.CContext.cg procname callee_name; + + let param_exps, instr_block_param, ids_block_param = + extract_block_from_tuple procname res_trans_par.exps sil_loc in + + let ret_id = + if Sil.typ_equal method_type Sil.Tvoid then [] + else [Ident.create_fresh Ident.knormal] in let call_flags = { Sil.cf_virtual = is_virtual; Sil.cf_noreturn = false; Sil.cf_is_objc_block = false; } in - let param_exps, instr_block_param, ids_block_param = - extract_block_from_tuple procname res_trans_par.exps sil_loc in + let stmt_call = Sil.Call (ret_id, (Sil.Const (Sil.Cfun callee_name)), param_exps, sil_loc, call_flags) in let selector = obj_c_message_expr_info.Clang_ast_t.omei_selector in let nname = "Message Call: "^selector in let res_trans_tmp = { res_trans_par with - ids = ret_id @ res_trans_par.ids @ids_block_param ; + ids = res_trans_par.ids @ ids_block_param @ ret_id; instrs = res_trans_par.instrs @ instr_block_param @ [stmt_call]; exps = [] } in diff --git a/infer/tests/codetoanalyze/objc/errors/category_procdesc/main.dot b/infer/tests/codetoanalyze/objc/errors/category_procdesc/main.dot index 86f67bc7a..085d65464 100644 --- a/infer/tests/codetoanalyze/objc/errors/category_procdesc/main.dot +++ b/infer/tests/codetoanalyze/objc/errors/category_procdesc/main.dot @@ -1,5 +1,5 @@ digraph iCFG { -6 [label="6: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class EOCPerson ):unsigned long ) [line 14]\n n$2=_fun_NSObject_init(n$4:class EOCPerson *) virtual [line 14]\n *&person:class EOCPerson *=n$2 [line 14]\n REMOVE_TEMPS(n$2,n$4); [line 14]\n " shape="box"] +6 [label="6: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class EOCPerson ):unsigned long ) [line 14]\n n$3=_fun_NSObject_init(n$2:class EOCPerson *) virtual [line 14]\n *&person:class EOCPerson *=n$3 [line 14]\n REMOVE_TEMPS(n$2,n$3); [line 14]\n " shape="box"] 6 -> 5 ; diff --git a/infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot b/infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot index 2e8883f7e..6937d2eff 100644 --- a/infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/field_superclass/SuperExample.dot @@ -1,5 +1,5 @@ digraph iCFG { -12 [label="12: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 45]\n n$3=_fun_NSObject_init(n$2:class A *) virtual [line 45]\n *&a:struct objc_object *=n$3 [line 45]\n REMOVE_TEMPS(n$2,n$3); [line 45]\n NULLIFY(&a,false); [line 45]\n " shape="box"] +12 [label="12: DeclStmt \n n$1=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 45]\n n$2=_fun_NSObject_init(n$1:class A *) virtual [line 45]\n *&a:struct objc_object *=n$2 [line 45]\n REMOVE_TEMPS(n$1,n$2); [line 45]\n NULLIFY(&a,false); [line 45]\n " shape="box"] 12 -> 11 ; @@ -14,7 +14,7 @@ digraph iCFG { 9 -> 12 ; -8 [label="8: BinaryOperatorStmt: Assign \n n$3=*&self:class A * [line 36]\n n$2=_fun_B_init(n$3:class A *) [line 36]\n *&self:class A *=n$2 [line 36]\n REMOVE_TEMPS(n$2,n$3); [line 36]\n " shape="box"] +8 [label="8: BinaryOperatorStmt: Assign \n n$2=*&self:class A * [line 36]\n n$3=_fun_B_init(n$2:class A *) [line 36]\n *&self:class A *=n$3 [line 36]\n REMOVE_TEMPS(n$2,n$3); [line 36]\n " shape="box"] 8 -> 7 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot index f9389f6be..97cefa68b 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/ArcExample.dot @@ -1,13 +1,13 @@ digraph iCFG { -16 [label="16: Message Call: retain \n n$17=*&son:class A * [line 16]\n n$16=_fun___objc_retain(n$17:class A *) [line 16]\n REMOVE_TEMPS(n$16,n$17); [line 16]\n " shape="box"] +16 [label="16: Message Call: retain \n n$14=*&son:class A * [line 16]\n n$15=_fun___objc_retain(n$14:class A *) [line 16]\n REMOVE_TEMPS(n$14,n$15); [line 16]\n " shape="box"] 16 -> 15 ; -15 [label="15: Message Call: release \n n$14=*&self:class A * [line 16]\n n$15=*n$14._son:class A * [line 16]\n n$13=_fun___objc_release(n$15:class A *) [line 16]\n REMOVE_TEMPS(n$13,n$14,n$15); [line 16]\n " shape="box"] +15 [label="15: Message Call: release \n n$11=*&self:class A * [line 16]\n n$12=*n$11._son:class A * [line 16]\n n$13=_fun___objc_release(n$12:class A *) [line 16]\n REMOVE_TEMPS(n$11,n$12,n$13); [line 16]\n " shape="box"] 15 -> 14 ; -14 [label="14: BinaryOperatorStmt: Assign \n n$10=*&self:class A * [line 16]\n n$11=*&son:class A * [line 16]\n _fun___objc_retain(n$11:class A *) [line 16]\n n$12=*n$10._son:class A * [line 16]\n *n$10._son:class A *=n$11 [line 16]\n _fun___objc_release(n$12:class A *) [line 16]\n REMOVE_TEMPS(n$10,n$11,n$12); [line 16]\n NULLIFY(&self,false); [line 16]\n NULLIFY(&son,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] +14 [label="14: BinaryOperatorStmt: Assign \n n$8=*&self:class A * [line 16]\n n$9=*&son:class A * [line 16]\n _fun___objc_retain(n$9:class A *) [line 16]\n n$10=*n$8._son:class A * [line 16]\n *n$8._son:class A *=n$9 [line 16]\n _fun___objc_release(n$10:class A *) [line 16]\n REMOVE_TEMPS(n$8,n$9,n$10); [line 16]\n NULLIFY(&self,false); [line 16]\n NULLIFY(&son,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] 14 -> 13 ; @@ -18,7 +18,7 @@ digraph iCFG { 12 -> 16 ; -11 [label="11: Return Stmt \n n$7=*&self:class A * [line 16]\n n$8=*n$7._son:class A * [line 16]\n *&return:class A *=n$8 [line 16]\n n$9=_fun___set_autorelease_attribute(n$8:class A *) [line 16]\n REMOVE_TEMPS(n$7,n$8,n$9); [line 16]\n NULLIFY(&self,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] +11 [label="11: Return Stmt \n n$5=*&self:class A * [line 16]\n n$6=*n$5._son:class A * [line 16]\n *&return:class A *=n$6 [line 16]\n n$7=_fun___set_autorelease_attribute(n$6:class A *) [line 16]\n REMOVE_TEMPS(n$5,n$6,n$7); [line 16]\n NULLIFY(&self,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] 11 -> 10 ; @@ -29,11 +29,11 @@ digraph iCFG { 9 -> 11 ; -8 [label="8: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 29]\n *&s:class NSString *=n$6 [line 29]\n REMOVE_TEMPS(n$6); [line 29]\n " shape="box"] +8 [label="8: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 29]\n *&s:class NSString *=n$4 [line 29]\n REMOVE_TEMPS(n$4); [line 29]\n " shape="box"] 8 -> 7 ; -7 [label="7: Return Stmt \n n$4=*&s:class NSString * [line 30]\n *&return:class NSString *=n$4 [line 30]\n REMOVE_TEMPS(n$4); [line 30]\n NULLIFY(&s,false); [line 30]\n APPLY_ABSTRACTION; [line 30]\n " shape="box"] +7 [label="7: Return Stmt \n n$3=*&s:class NSString * [line 30]\n *&return:class NSString *=n$3 [line 30]\n REMOVE_TEMPS(n$3); [line 30]\n NULLIFY(&s,false); [line 30]\n APPLY_ABSTRACTION; [line 30]\n " shape="box"] 7 -> 6 ; @@ -44,7 +44,7 @@ digraph iCFG { 5 -> 8 ; -4 [label="4: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 23]\n *&s:class NSString *=n$3 [line 23]\n REMOVE_TEMPS(n$3); [line 23]\n " shape="box"] +4 [label="4: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 23]\n *&s:class NSString *=n$2 [line 23]\n REMOVE_TEMPS(n$2); [line 23]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot index 2dd59d833..bcfa80bd0 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/AutoreleaseExample.dot @@ -1,9 +1,9 @@ digraph iCFG { -41 [label="41: DeclStmt \n n$7=_fun___objc_alloc_no_fail(sizeof(class NSAutoreleasePool ):unsigned long ) [line 60]\n n$5=_fun_NSObject_init(n$7:class NSAutoreleasePool *) virtual [line 60]\n *&pool:class NSAutoreleasePool *=n$5 [line 60]\n REMOVE_TEMPS(n$5,n$7); [line 60]\n " shape="box"] +41 [label="41: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class NSAutoreleasePool ):unsigned long ) [line 60]\n n$5=_fun_NSObject_init(n$4:class NSAutoreleasePool *) virtual [line 60]\n *&pool:class NSAutoreleasePool *=n$5 [line 60]\n REMOVE_TEMPS(n$4,n$5); [line 60]\n " shape="box"] 41 -> 40 ; -40 [label="40: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 61]\n n$2=_fun___set_autorelease_attribute(n$4:class NSString *) [line 61]\n *&string:class NSString *=n$2 [line 61]\n REMOVE_TEMPS(n$2,n$4); [line 61]\n " shape="box"] +40 [label="40: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 61]\n n$3=_fun___set_autorelease_attribute(n$2:class NSString *) [line 61]\n *&string:class NSString *=n$3 [line 61]\n REMOVE_TEMPS(n$2,n$3); [line 61]\n " shape="box"] 40 -> 39 ; @@ -77,7 +77,7 @@ digraph iCFG { 22 -> 21 ; -21 [label="21: Message Call: retain \n n$4=*&s1:class A * [line 40]\n n$3=_fun___objc_retain(n$4:class A *) [line 40]\n REMOVE_TEMPS(n$3,n$4); [line 40]\n " shape="box"] +21 [label="21: Message Call: retain \n n$3=*&s1:class A * [line 40]\n n$4=_fun___objc_retain(n$3:class A *) [line 40]\n REMOVE_TEMPS(n$3,n$4); [line 40]\n " shape="box"] 21 -> 20 ; @@ -104,11 +104,11 @@ digraph iCFG { 15 -> 25 ; -14 [label="14: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 30]\n n$2=_fun_NSObject_init(n$4:class A *) virtual [line 30]\n *&s1:class A *=n$2 [line 30]\n REMOVE_TEMPS(n$2,n$4); [line 30]\n " shape="box"] +14 [label="14: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 30]\n n$3=_fun_NSObject_init(n$2:class A *) virtual [line 30]\n *&s1:class A *=n$3 [line 30]\n REMOVE_TEMPS(n$2,n$3); [line 30]\n " shape="box"] 14 -> 13 ; -13 [label="13: Return Stmt \n n$1=*&s1:class A * [line 31]\n n$0=_fun___set_autorelease_attribute(n$1:class A *) [line 31]\n *&return:class A *=n$0 [line 31]\n REMOVE_TEMPS(n$0,n$1); [line 31]\n NULLIFY(&s1,false); [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="box"] +13 [label="13: Return Stmt \n n$0=*&s1:class A * [line 31]\n n$1=_fun___set_autorelease_attribute(n$0:class A *) [line 31]\n *&return:class A *=n$1 [line 31]\n REMOVE_TEMPS(n$0,n$1); [line 31]\n NULLIFY(&s1,false); [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="box"] 13 -> 12 ; @@ -119,7 +119,7 @@ digraph iCFG { 11 -> 14 ; -10 [label="10: BinaryOperatorStmt: Assign \n n$6=*&self:class A * [line 17]\n n$7=*&son:class A * [line 17]\n *n$6._son:class A *=n$7 [line 17]\n REMOVE_TEMPS(n$6,n$7); [line 17]\n NULLIFY(&self,false); [line 17]\n NULLIFY(&son,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] +10 [label="10: BinaryOperatorStmt: Assign \n n$5=*&self:class A * [line 17]\n n$6=*&son:class A * [line 17]\n *n$5._son:class A *=n$6 [line 17]\n REMOVE_TEMPS(n$5,n$6); [line 17]\n NULLIFY(&self,false); [line 17]\n NULLIFY(&son,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] 10 -> 9 ; @@ -130,7 +130,7 @@ digraph iCFG { 8 -> 10 ; -7 [label="7: Return Stmt \n n$4=*&self:class A * [line 17]\n n$5=*n$4._son:class A * [line 17]\n *&return:class A *=n$5 [line 17]\n REMOVE_TEMPS(n$4,n$5); [line 17]\n NULLIFY(&self,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] +7 [label="7: Return Stmt \n n$3=*&self:class A * [line 17]\n n$4=*n$3._son:class A * [line 17]\n *&return:class A *=n$4 [line 17]\n REMOVE_TEMPS(n$3,n$4); [line 17]\n NULLIFY(&self,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] 7 -> 6 ; @@ -141,11 +141,11 @@ digraph iCFG { 5 -> 7 ; -4 [label="4: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 23]\n *&s:class NSString *=n$3 [line 23]\n REMOVE_TEMPS(n$3); [line 23]\n " shape="box"] +4 [label="4: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 23]\n *&s:class NSString *=n$2 [line 23]\n REMOVE_TEMPS(n$2); [line 23]\n " shape="box"] 4 -> 3 ; -3 [label="3: Return Stmt \n n$1=*&s:class NSString * [line 24]\n n$0=_fun___set_autorelease_attribute(n$1:class NSString *) [line 24]\n *&return:class NSString *=n$0 [line 24]\n REMOVE_TEMPS(n$0,n$1); [line 24]\n NULLIFY(&s,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +3 [label="3: Return Stmt \n n$0=*&s:class NSString * [line 24]\n n$1=_fun___set_autorelease_attribute(n$0:class NSString *) [line 24]\n *&return:class NSString *=n$1 [line 24]\n REMOVE_TEMPS(n$0,n$1); [line 24]\n NULLIFY(&s,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot index e0dc65927..1e6b47ed9 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/MemoryLeakExample.dot @@ -1,9 +1,9 @@ digraph iCFG { -48 [label="48: DeclStmt \n n$36=_fun_FBColorCreateWithGray(0.000000:double ,0.300000:double ) [line 95]\n *&borderColor:struct CGColor *=n$36 [line 95]\n REMOVE_TEMPS(n$36); [line 95]\n " shape="box"] +48 [label="48: DeclStmt \n n$35=_fun_FBColorCreateWithGray(0.000000:double ,0.300000:double ) [line 95]\n *&borderColor:struct CGColor *=n$35 [line 95]\n REMOVE_TEMPS(n$35); [line 95]\n " shape="box"] 48 -> 47 ; -47 [label="47: Call _fun_CGColorRelease \n n$35=*&borderColor:struct CGColor * [line 96]\n _fun_CGColorRelease(n$35:struct CGColor *) [line 96]\n REMOVE_TEMPS(n$35); [line 96]\n NULLIFY(&borderColor,false); [line 96]\n APPLY_ABSTRACTION; [line 96]\n " shape="box"] +47 [label="47: Call _fun_CGColorRelease \n n$34=*&borderColor:struct CGColor * [line 96]\n _fun_CGColorRelease(n$34:struct CGColor *) [line 96]\n REMOVE_TEMPS(n$34); [line 96]\n NULLIFY(&borderColor,false); [line 96]\n APPLY_ABSTRACTION; [line 96]\n " shape="box"] 47 -> 46 ; @@ -14,11 +14,11 @@ digraph iCFG { 45 -> 48 ; -44 [label="44: DeclStmt \n n$34=_fun_CGBitmapContextCreateImage(0:struct CGContext *) [line 87]\n *&newImage:struct CGImage *=n$34 [line 87]\n REMOVE_TEMPS(n$34); [line 87]\n " shape="box"] +44 [label="44: DeclStmt \n n$33=_fun_CGBitmapContextCreateImage(0:struct CGContext *) [line 87]\n *&newImage:struct CGImage *=n$33 [line 87]\n REMOVE_TEMPS(n$33); [line 87]\n " shape="box"] 44 -> 43 ; -43 [label="43: Call _fun_CGImageRelease \n n$33=*&newImage:struct CGImage * [line 88]\n _fun_CGImageRelease(n$33:struct CGImage *) [line 88]\n REMOVE_TEMPS(n$33); [line 88]\n NULLIFY(&newImage,false); [line 88]\n APPLY_ABSTRACTION; [line 88]\n " shape="box"] +43 [label="43: Call _fun_CGImageRelease \n n$32=*&newImage:struct CGImage * [line 88]\n _fun_CGImageRelease(n$32:struct CGImage *) [line 88]\n REMOVE_TEMPS(n$32); [line 88]\n NULLIFY(&newImage,false); [line 88]\n APPLY_ABSTRACTION; [line 88]\n " shape="box"] 43 -> 42 ; @@ -29,11 +29,11 @@ digraph iCFG { 41 -> 44 ; -40 [label="40: DeclStmt \n n$32=_fun_SecTrustCopyPublicKey(0:struct __SecTrust *) [line 81]\n *&allowedPublicKey:struct __SecKey *=n$32 [line 81]\n REMOVE_TEMPS(n$32); [line 81]\n " shape="box"] +40 [label="40: DeclStmt \n n$31=_fun_SecTrustCopyPublicKey(0:struct __SecTrust *) [line 81]\n *&allowedPublicKey:struct __SecKey *=n$31 [line 81]\n REMOVE_TEMPS(n$31); [line 81]\n " shape="box"] 40 -> 39 ; -39 [label="39: Call _fun___objc_release_cf \n n$31=*&allowedPublicKey:struct __SecKey * [line 82]\n _fun___objc_release_cf(1:_Bool ,n$31:void *) [line 82]\n REMOVE_TEMPS(n$31); [line 82]\n NULLIFY(&allowedPublicKey,false); [line 82]\n APPLY_ABSTRACTION; [line 82]\n " shape="box"] +39 [label="39: Call _fun___objc_release_cf \n n$30=*&allowedPublicKey:struct __SecKey * [line 82]\n _fun___objc_release_cf(1:_Bool ,n$30:void *) [line 82]\n REMOVE_TEMPS(n$30); [line 82]\n NULLIFY(&allowedPublicKey,false); [line 82]\n APPLY_ABSTRACTION; [line 82]\n " shape="box"] 39 -> 38 ; @@ -44,7 +44,7 @@ digraph iCFG { 37 -> 40 ; -36 [label="36: DeclStmt \n n$29=*&trust:struct __SecTrust * [line 76]\n n$30=_fun_SecTrustCopyPublicKey(n$29:struct __SecTrust *) [line 76]\n *&allowedPublicKey:struct __SecKey *=n$30 [line 76]\n REMOVE_TEMPS(n$29,n$30); [line 76]\n NULLIFY(&allowedPublicKey,false); [line 76]\n NULLIFY(&trust,false); [line 76]\n APPLY_ABSTRACTION; [line 76]\n " shape="box"] +36 [label="36: DeclStmt \n n$28=*&trust:struct __SecTrust * [line 76]\n n$29=_fun_SecTrustCopyPublicKey(n$28:struct __SecTrust *) [line 76]\n *&allowedPublicKey:struct __SecKey *=n$29 [line 76]\n REMOVE_TEMPS(n$28,n$29); [line 76]\n NULLIFY(&allowedPublicKey,false); [line 76]\n NULLIFY(&trust,false); [line 76]\n APPLY_ABSTRACTION; [line 76]\n " shape="box"] 36 -> 35 ; @@ -55,15 +55,15 @@ digraph iCFG { 34 -> 36 ; -33 [label="33: DeclStmt \n n$27=*&rect:struct CGRect [line 67]\n n$28=_fun_CGRectGetHeight(n$27:struct CGRect ) [line 67]\n *&lineThickness:double =(0.200000 * n$28) [line 67]\n REMOVE_TEMPS(n$27,n$28); [line 67]\n NULLIFY(&rect,false); [line 67]\n NULLIFY(&lineThickness,false); [line 67]\n " shape="box"] +33 [label="33: DeclStmt \n n$26=*&rect:struct CGRect [line 67]\n n$27=_fun_CGRectGetHeight(n$26:struct CGRect ) [line 67]\n *&lineThickness:double =(0.200000 * n$27) [line 67]\n REMOVE_TEMPS(n$26,n$27); [line 67]\n NULLIFY(&rect,false); [line 67]\n NULLIFY(&lineThickness,false); [line 67]\n " shape="box"] 33 -> 32 ; -32 [label="32: DeclStmt \n n$26=_fun_CGPathCreateMutable() [line 70]\n *&path1:struct CGPath *=n$26 [line 70]\n REMOVE_TEMPS(n$26); [line 70]\n " shape="box"] +32 [label="32: DeclStmt \n n$25=_fun_CGPathCreateMutable() [line 70]\n *&path1:struct CGPath *=n$25 [line 70]\n REMOVE_TEMPS(n$25); [line 70]\n " shape="box"] 32 -> 31 ; -31 [label="31: Call _fun___objc_release_cf \n n$25=*&path1:struct CGPath * [line 71]\n _fun___objc_release_cf(1:_Bool ,n$25:void *) [line 71]\n REMOVE_TEMPS(n$25); [line 71]\n NULLIFY(&path1,false); [line 71]\n APPLY_ABSTRACTION; [line 71]\n " shape="box"] +31 [label="31: Call _fun___objc_release_cf \n n$24=*&path1:struct CGPath * [line 71]\n _fun___objc_release_cf(1:_Bool ,n$24:void *) [line 71]\n REMOVE_TEMPS(n$24); [line 71]\n NULLIFY(&path1,false); [line 71]\n APPLY_ABSTRACTION; [line 71]\n " shape="box"] 31 -> 30 ; @@ -74,11 +74,11 @@ digraph iCFG { 29 -> 33 ; -28 [label="28: DeclStmt \n n$23=*&rect:struct CGRect [line 59]\n n$24=_fun_CGRectGetHeight(n$23:struct CGRect ) [line 59]\n *&lineThickness:double =(0.200000 * n$24) [line 59]\n REMOVE_TEMPS(n$23,n$24); [line 59]\n NULLIFY(&rect,false); [line 59]\n NULLIFY(&lineThickness,false); [line 59]\n " shape="box"] +28 [label="28: DeclStmt \n n$22=*&rect:struct CGRect [line 59]\n n$23=_fun_CGRectGetHeight(n$22:struct CGRect ) [line 59]\n *&lineThickness:double =(0.200000 * n$23) [line 59]\n REMOVE_TEMPS(n$22,n$23); [line 59]\n NULLIFY(&rect,false); [line 59]\n NULLIFY(&lineThickness,false); [line 59]\n " shape="box"] 28 -> 27 ; -27 [label="27: DeclStmt \n n$22=_fun_CGPathCreateMutable() [line 62]\n *&path1:struct CGPath *=n$22 [line 62]\n REMOVE_TEMPS(n$22); [line 62]\n NULLIFY(&path1,false); [line 62]\n APPLY_ABSTRACTION; [line 62]\n " shape="box"] +27 [label="27: DeclStmt \n n$21=_fun_CGPathCreateMutable() [line 62]\n *&path1:struct CGPath *=n$21 [line 62]\n REMOVE_TEMPS(n$21); [line 62]\n NULLIFY(&path1,false); [line 62]\n APPLY_ABSTRACTION; [line 62]\n " shape="box"] 27 -> 26 ; @@ -89,11 +89,11 @@ digraph iCFG { 25 -> 28 ; -24 [label="24: DeclStmt \n n$21=_fun_CTFramesetterCreateWithAttributedString(0:struct __CFAttributedString *) [line 53]\n *&framesetter:struct __CTFramesetter *=n$21 [line 53]\n REMOVE_TEMPS(n$21); [line 53]\n " shape="box"] +24 [label="24: DeclStmt \n n$20=_fun_CTFramesetterCreateWithAttributedString(0:struct __CFAttributedString *) [line 53]\n *&framesetter:struct __CTFramesetter *=n$20 [line 53]\n REMOVE_TEMPS(n$20); [line 53]\n " shape="box"] 24 -> 23 ; -23 [label="23: Call _fun___objc_release_cf \n n$20=*&framesetter:struct __CTFramesetter * [line 54]\n _fun___objc_release_cf(1:_Bool ,n$20:void *) [line 54]\n REMOVE_TEMPS(n$20); [line 54]\n NULLIFY(&framesetter,false); [line 54]\n APPLY_ABSTRACTION; [line 54]\n " shape="box"] +23 [label="23: Call _fun___objc_release_cf \n n$19=*&framesetter:struct __CTFramesetter * [line 54]\n _fun___objc_release_cf(1:_Bool ,n$19:void *) [line 54]\n REMOVE_TEMPS(n$19); [line 54]\n NULLIFY(&framesetter,false); [line 54]\n APPLY_ABSTRACTION; [line 54]\n " shape="box"] 23 -> 22 ; @@ -104,7 +104,7 @@ digraph iCFG { 21 -> 24 ; -20 [label="20: DeclStmt \n n$18=*&str:struct __CFAttributedString * [line 48]\n n$19=_fun_CTFramesetterCreateWithAttributedString(n$18:struct __CFAttributedString *) [line 48]\n *&framesetter:struct __CTFramesetter *=n$19 [line 48]\n REMOVE_TEMPS(n$18,n$19); [line 48]\n NULLIFY(&framesetter,false); [line 48]\n NULLIFY(&str,false); [line 48]\n APPLY_ABSTRACTION; [line 48]\n " shape="box"] +20 [label="20: DeclStmt \n n$17=*&str:struct __CFAttributedString * [line 48]\n n$18=_fun_CTFramesetterCreateWithAttributedString(n$17:struct __CFAttributedString *) [line 48]\n *&framesetter:struct __CTFramesetter *=n$18 [line 48]\n REMOVE_TEMPS(n$17,n$18); [line 48]\n NULLIFY(&framesetter,false); [line 48]\n NULLIFY(&str,false); [line 48]\n APPLY_ABSTRACTION; [line 48]\n " shape="box"] 20 -> 19 ; @@ -115,11 +115,11 @@ digraph iCFG { 18 -> 20 ; -17 [label="17: DeclStmt \n n$17=_fun_CFAttributedStringCreateMutable(0:struct __CFAllocator *,0:long ) [line 42]\n *&maString:struct __CFAttributedString *=n$17 [line 42]\n REMOVE_TEMPS(n$17); [line 42]\n " shape="box"] +17 [label="17: DeclStmt \n n$16=_fun_CFAttributedStringCreateMutable(0:struct __CFAllocator *,0:long ) [line 42]\n *&maString:struct __CFAttributedString *=n$16 [line 42]\n REMOVE_TEMPS(n$16); [line 42]\n " shape="box"] 17 -> 16 ; -16 [label="16: Call _fun___objc_release_cf \n n$16=*&maString:struct __CFAttributedString * [line 43]\n _fun___objc_release_cf(1:_Bool ,n$16:void *) [line 43]\n REMOVE_TEMPS(n$16); [line 43]\n NULLIFY(&maString,false); [line 43]\n APPLY_ABSTRACTION; [line 43]\n " shape="box"] +16 [label="16: Call _fun___objc_release_cf \n n$15=*&maString:struct __CFAttributedString * [line 43]\n _fun___objc_release_cf(1:_Bool ,n$15:void *) [line 43]\n REMOVE_TEMPS(n$15); [line 43]\n NULLIFY(&maString,false); [line 43]\n APPLY_ABSTRACTION; [line 43]\n " shape="box"] 16 -> 15 ; @@ -130,7 +130,7 @@ digraph iCFG { 14 -> 17 ; -13 [label="13: DeclStmt \n n$15=_fun_CFAttributedStringCreateMutable(0:struct __CFAllocator *,0:long ) [line 37]\n *&maString:struct __CFAttributedString *=n$15 [line 37]\n REMOVE_TEMPS(n$15); [line 37]\n NULLIFY(&maString,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +13 [label="13: DeclStmt \n n$14=_fun_CFAttributedStringCreateMutable(0:struct __CFAllocator *,0:long ) [line 37]\n *&maString:struct __CFAttributedString *=n$14 [line 37]\n REMOVE_TEMPS(n$14); [line 37]\n NULLIFY(&maString,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] 13 -> 12 ; @@ -141,11 +141,11 @@ digraph iCFG { 11 -> 13 ; -10 [label="10: DeclStmt \n n$13=*&self:class MemoryLeakExample * [line 31]\n n$12=_fun_MemoryLeakExample_backgroundCoveringView(n$13:class MemoryLeakExample *) virtual [line 31]\n n$11=_fun_UIView_bounds(n$12:class UIView *) virtual [line 31]\n n$14=_fun_CGPathCreateWithRect(n$11:struct CGRect ,0:struct CGAffineTransform *) [line 31]\n *&shadowPath:struct CGPath *=n$14 [line 31]\n REMOVE_TEMPS(n$11,n$12,n$13,n$14); [line 31]\n " shape="box"] +10 [label="10: DeclStmt \n n$10=*&self:class MemoryLeakExample * [line 31]\n n$11=_fun_MemoryLeakExample_backgroundCoveringView(n$10:class MemoryLeakExample *) virtual [line 31]\n n$12=_fun_UIView_bounds(n$11:class UIView *) virtual [line 31]\n n$13=_fun_CGPathCreateWithRect(n$12:struct CGRect ,0:struct CGAffineTransform *) [line 31]\n *&shadowPath:struct CGPath *=n$13 [line 31]\n REMOVE_TEMPS(n$10,n$11,n$12,n$13); [line 31]\n " shape="box"] 10 -> 9 ; -9 [label="9: Message Call: setShadowPath: \n n$9=*&self:class MemoryLeakExample * [line 32]\n n$8=_fun_MemoryLeakExample_backgroundCoveringView(n$9:class MemoryLeakExample *) virtual [line 32]\n n$7=_fun_UIView_layer(n$8:class UIView *) virtual [line 32]\n n$10=*&shadowPath:struct CGPath * [line 32]\n _fun_CALayer_setShadowPath:(n$7:class CALayer *,n$10:struct CGPath *) virtual [line 32]\n REMOVE_TEMPS(n$7,n$8,n$9,n$10); [line 32]\n NULLIFY(&self,false); [line 32]\n NULLIFY(&shadowPath,false); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] +9 [label="9: Message Call: setShadowPath: \n n$6=*&self:class MemoryLeakExample * [line 32]\n n$7=_fun_MemoryLeakExample_backgroundCoveringView(n$6:class MemoryLeakExample *) virtual [line 32]\n n$8=_fun_UIView_layer(n$7:class UIView *) virtual [line 32]\n n$9=*&shadowPath:struct CGPath * [line 32]\n _fun_CALayer_setShadowPath:(n$8:class CALayer *,n$9:struct CGPath *) virtual [line 32]\n REMOVE_TEMPS(n$6,n$7,n$8,n$9); [line 32]\n NULLIFY(&self,false); [line 32]\n NULLIFY(&shadowPath,false); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] 9 -> 8 ; @@ -156,11 +156,11 @@ digraph iCFG { 7 -> 10 ; -6 [label="6: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class UIView ):unsigned long ) [line 21]\n *&attachmentContainerView:class UIView *=n$6 [line 21]\n REMOVE_TEMPS(n$6); [line 21]\n " shape="box"] +6 [label="6: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class UIView ):unsigned long ) [line 21]\n *&attachmentContainerView:class UIView *=n$5 [line 21]\n REMOVE_TEMPS(n$5); [line 21]\n " shape="box"] 6 -> 5 ; -5 [label="5: DeclStmt \n n$3=*&attachmentContainerView:class UIView * [line 22]\n n$2=_fun_UIView_bounds(n$3:class UIView *) virtual [line 22]\n n$4=_fun_CGPathCreateWithRect(n$2:struct CGRect ,0:struct CGAffineTransform *) [line 22]\n *&shadowPath:struct CGPath *=n$4 [line 22]\n REMOVE_TEMPS(n$2,n$3,n$4); [line 22]\n " shape="box"] +5 [label="5: DeclStmt \n n$2=*&attachmentContainerView:class UIView * [line 22]\n n$3=_fun_UIView_bounds(n$2:class UIView *) virtual [line 22]\n n$4=_fun_CGPathCreateWithRect(n$3:struct CGRect ,0:struct CGAffineTransform *) [line 22]\n *&shadowPath:struct CGPath *=n$4 [line 22]\n REMOVE_TEMPS(n$2,n$3,n$4); [line 22]\n " shape="box"] 5 -> 4 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot index be09771bb..c6074171e 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample.dot @@ -1,9 +1,9 @@ digraph iCFG { -5 [label="5: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 21]\n n$3=_fun_NSObject_init(n$5:class A *) virtual [line 21]\n *&a:class A *=n$3 [line 21]\n REMOVE_TEMPS(n$3,n$5); [line 21]\n " shape="box"] +5 [label="5: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 21]\n n$4=_fun_NSObject_init(n$3:class A *) virtual [line 21]\n *&a:class A *=n$4 [line 21]\n REMOVE_TEMPS(n$3,n$4); [line 21]\n " shape="box"] 5 -> 4 ; -4 [label="4: Message Call: retain \n n$2=*&a:class A * [line 22]\n n$1=_fun___objc_retain(n$2:class A *) [line 22]\n REMOVE_TEMPS(n$1,n$2); [line 22]\n " shape="box"] +4 [label="4: Message Call: retain \n n$1=*&a:class A * [line 22]\n n$2=_fun___objc_retain(n$1:class A *) [line 22]\n REMOVE_TEMPS(n$1,n$2); [line 22]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot index 6ae541cd3..11507f728 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/RetainReleaseExample2.dot @@ -23,11 +23,11 @@ digraph iCFG { 27 -> 30 ; 27 -> 31 ; -26 [label="26: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 62]\n n$3=_fun_NSObject_init(n$5:class A *) virtual [line 62]\n *&a:class A *=n$3 [line 62]\n REMOVE_TEMPS(n$3,n$5); [line 62]\n " shape="box"] +26 [label="26: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 62]\n n$4=_fun_NSObject_init(n$3:class A *) virtual [line 62]\n *&a:class A *=n$4 [line 62]\n REMOVE_TEMPS(n$3,n$4); [line 62]\n " shape="box"] 26 -> 25 ; -25 [label="25: Message Call: retain \n n$2=*&a:class A * [line 63]\n n$1=_fun___objc_retain(n$2:class A *) [line 63]\n REMOVE_TEMPS(n$1,n$2); [line 63]\n " shape="box"] +25 [label="25: Message Call: retain \n n$1=*&a:class A * [line 63]\n n$2=_fun___objc_retain(n$1:class A *) [line 63]\n REMOVE_TEMPS(n$1,n$2); [line 63]\n " shape="box"] 25 -> 24 ; @@ -42,7 +42,7 @@ digraph iCFG { 22 -> 26 ; -21 [label="21: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 55]\n n$1=_fun_NSObject_init(n$3:class A *) virtual [line 55]\n *&a:class A *=n$1 [line 55]\n REMOVE_TEMPS(n$1,n$3); [line 55]\n " shape="box"] +21 [label="21: DeclStmt \n n$1=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 55]\n n$2=_fun_NSObject_init(n$1:class A *) virtual [line 55]\n *&a:class A *=n$2 [line 55]\n REMOVE_TEMPS(n$1,n$2); [line 55]\n " shape="box"] 21 -> 20 ; @@ -98,11 +98,11 @@ digraph iCFG { 7 -> 10 ; -6 [label="6: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 26]\n n$4=_fun_NSObject_init(n$6:class A *) virtual [line 26]\n *&a:class A *=n$4 [line 26]\n REMOVE_TEMPS(n$4,n$6); [line 26]\n " shape="box"] +6 [label="6: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 26]\n n$5=_fun_NSObject_init(n$4:class A *) virtual [line 26]\n *&a:class A *=n$5 [line 26]\n REMOVE_TEMPS(n$4,n$5); [line 26]\n " shape="box"] 6 -> 5 ; -5 [label="5: Message Call: retain \n n$3=*&a:class A * [line 27]\n n$2=_fun___objc_retain(n$3:class A *) [line 27]\n REMOVE_TEMPS(n$2,n$3); [line 27]\n " shape="box"] +5 [label="5: Message Call: retain \n n$2=*&a:class A * [line 27]\n n$3=_fun___objc_retain(n$2:class A *) [line 27]\n REMOVE_TEMPS(n$2,n$3); [line 27]\n " shape="box"] 5 -> 4 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.dot index f6e154985..567feba2d 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/TollBridgeExample.dot @@ -10,11 +10,11 @@ digraph iCFG { 17 -> 19 ; -16 [label="16: DeclStmt \n n$9=_fun_CFHTTPMessageCopyAllHeaderFields(0:struct __CFHTTPMessage *) [line 38]\n *&ref:struct __CFDictionary *=n$9 [line 38]\n REMOVE_TEMPS(n$9); [line 38]\n " shape="box"] +16 [label="16: DeclStmt \n n$8=_fun_CFHTTPMessageCopyAllHeaderFields(0:struct __CFHTTPMessage *) [line 38]\n *&ref:struct __CFDictionary *=n$8 [line 38]\n REMOVE_TEMPS(n$8); [line 38]\n " shape="box"] 16 -> 15 ; -15 [label="15: Call _fun_CFBridgingRelease \n n$7=*&ref:struct __CFDictionary * [line 39]\n n$8=_fun___objc_cast(n$7:void *,sizeof(struct objc_object ):unsigned long ) [line 39]\n REMOVE_TEMPS(n$7,n$8); [line 39]\n NULLIFY(&ref,false); [line 39]\n APPLY_ABSTRACTION; [line 39]\n " shape="box"] +15 [label="15: Call _fun_CFBridgingRelease \n n$6=*&ref:struct __CFDictionary * [line 39]\n n$7=_fun___objc_cast(n$6:void *,sizeof(struct objc_object ):unsigned long ) [line 39]\n REMOVE_TEMPS(n$6,n$7); [line 39]\n NULLIFY(&ref,false); [line 39]\n APPLY_ABSTRACTION; [line 39]\n " shape="box"] 15 -> 14 ; @@ -25,7 +25,7 @@ digraph iCFG { 13 -> 16 ; -12 [label="12: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class NSLocale ):unsigned long ) [line 32]\n *&observer:struct objc_object *=n$6 [line 32]\n REMOVE_TEMPS(n$6); [line 32]\n " shape="box"] +12 [label="12: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class NSLocale ):unsigned long ) [line 32]\n *&observer:struct objc_object *=n$5 [line 32]\n REMOVE_TEMPS(n$5); [line 32]\n " shape="box"] 12 -> 11 ; diff --git a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot index dd2e58bca..a61b92c81 100644 --- a/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot +++ b/infer/tests/codetoanalyze/objc/errors/memory_leaks_benchmark/arc_methods.dot @@ -26,11 +26,11 @@ digraph iCFG { 9 -> 15 ; -8 [label="8: DeclStmt \n n$8=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 28]\n n$6=_fun_NSObject_init(n$8:class A *) virtual [line 28]\n *&a:class A *=n$6 [line 28]\n REMOVE_TEMPS(n$6,n$8); [line 28]\n " shape="box"] +8 [label="8: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 28]\n n$6=_fun_NSObject_init(n$5:class A *) virtual [line 28]\n *&a:class A *=n$6 [line 28]\n REMOVE_TEMPS(n$5,n$6); [line 28]\n " shape="box"] 8 -> 7 ; -7 [label="7: Return Stmt \n n$4=*&a:class A * [line 30]\n *&return:class A *=n$4 [line 30]\n n$5=_fun___set_autorelease_attribute(n$4:class A *) [line 30]\n REMOVE_TEMPS(n$4,n$5); [line 30]\n NULLIFY(&a,false); [line 30]\n APPLY_ABSTRACTION; [line 30]\n " shape="box"] +7 [label="7: Return Stmt \n n$3=*&a:class A * [line 30]\n *&return:class A *=n$3 [line 30]\n n$4=_fun___set_autorelease_attribute(n$3:class A *) [line 30]\n REMOVE_TEMPS(n$3,n$4); [line 30]\n NULLIFY(&a,false); [line 30]\n APPLY_ABSTRACTION; [line 30]\n " shape="box"] 7 -> 6 ; @@ -41,7 +41,7 @@ digraph iCFG { 5 -> 8 ; -4 [label="4: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 23]\n n$1=_fun_NSObject_init(n$3:class A *) virtual [line 23]\n *&a:class A *=n$1 [line 23]\n REMOVE_TEMPS(n$1,n$3); [line 23]\n " shape="box"] +4 [label="4: DeclStmt \n n$1=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 23]\n n$2=_fun_NSObject_init(n$1:class A *) virtual [line 23]\n *&a:class A *=n$2 [line 23]\n REMOVE_TEMPS(n$1,n$2); [line 23]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot b/infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot index 3e6b485e7..5cfa3f06a 100644 --- a/infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot +++ b/infer/tests/codetoanalyze/objc/errors/npe/Nonnull_attribute_example.dot @@ -18,7 +18,7 @@ digraph iCFG { 16 -> 15 ; -15 [label="15: BinaryOperatorStmt: Assign \n n$10=*&self:class C * [line 31]\n n$12=*&name:class NSString * [line 31]\n n$11=_fun_NSString_copy(n$12:class NSString *) virtual [line 31]\n *n$10._name:class NSString *=n$11 [line 31]\n REMOVE_TEMPS(n$10,n$11,n$12); [line 31]\n NULLIFY(&name,false); [line 31]\n NULLIFY(&self,false); [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="box"] +15 [label="15: BinaryOperatorStmt: Assign \n n$10=*&self:class C * [line 31]\n n$11=*&name:class NSString * [line 31]\n n$12=_fun_NSString_copy(n$11:class NSString *) virtual [line 31]\n *n$10._name:class NSString *=n$12 [line 31]\n REMOVE_TEMPS(n$10,n$11,n$12); [line 31]\n NULLIFY(&name,false); [line 31]\n NULLIFY(&self,false); [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="box"] 15 -> 14 ; @@ -44,7 +44,7 @@ digraph iCFG { 9 -> 8 ; -8 [label="8: DeclStmt \n n$4=*&a:class A * [line 39]\n n$3=_fun_A_getA(n$4:class A *) virtual [line 39]\n _fun___objc_retain(n$3:class A *) [line 39]\n *&a1:class A *=n$3 [line 39]\n REMOVE_TEMPS(n$3,n$4); [line 39]\n NULLIFY(&a,false); [line 39]\n " shape="box"] +8 [label="8: DeclStmt \n n$3=*&a:class A * [line 39]\n n$4=_fun_A_getA(n$3:class A *) virtual [line 39]\n _fun___objc_retain(n$4:class A *) [line 39]\n *&a1:class A *=n$4 [line 39]\n REMOVE_TEMPS(n$3,n$4); [line 39]\n NULLIFY(&a,false); [line 39]\n " shape="box"] 8 -> 7 ; @@ -63,7 +63,7 @@ digraph iCFG { 4 -> 9 ; -3 [label="3: Return Stmt \n n$1=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 25]\n n$2=_fun_NSObject_init(n$1:class A *) virtual [line 25]\n *&return:class A *=n$2 [line 25]\n n$3=_fun___set_autorelease_attribute(n$2:class A *) [line 25]\n REMOVE_TEMPS(n$1,n$2,n$3); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] +3 [label="3: Return Stmt \n n$0=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 25]\n n$1=_fun_NSObject_init(n$0:class A *) virtual [line 25]\n *&return:class A *=n$1 [line 25]\n n$2=_fun___set_autorelease_attribute(n$1:class A *) [line 25]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.dot b/infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.dot index 81d995d7a..dfcb39bf8 100644 --- a/infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.dot +++ b/infer/tests/codetoanalyze/objc/errors/protocol_procdesc/main.dot @@ -1,5 +1,5 @@ digraph iCFG { -5 [label="5: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class Bicycle ):unsigned long ) [line 15]\n *&bike:class Bicycle *=n$2 [line 15]\n REMOVE_TEMPS(n$2); [line 15]\n " shape="box"] +5 [label="5: DeclStmt \n n$1=_fun___objc_alloc_no_fail(sizeof(class Bicycle ):unsigned long ) [line 15]\n *&bike:class Bicycle *=n$1 [line 15]\n REMOVE_TEMPS(n$1); [line 15]\n " shape="box"] 5 -> 4 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot index 820fd542d..55bbf4805 100644 --- a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot +++ b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot @@ -108,11 +108,11 @@ digraph iCFG { 98 -> 103 ; 98 -> 104 ; -97 [label="97: Return Stmt \n n$1=*&target:class A * [line 37]\n n$0=_fun_A_x(n$1:class A *) virtual [line 37]\n *&return:int =n$0 [line 37]\n REMOVE_TEMPS(n$0,n$1); [line 37]\n NULLIFY(&target,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +97 [label="97: Return Stmt \n n$0=*&target:class A * [line 37]\n n$3=_fun_A_x(n$0:class A *) virtual [line 37]\n *&return:int =n$3 [line 37]\n REMOVE_TEMPS(n$0,n$3); [line 37]\n NULLIFY(&target,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] 97 -> 93 ; -96 [label="96: Return Stmt \n n$2=*&self:class A * [line 13]\n n$3=*n$2._x:int [line 13]\n *&return:int =n$3 [line 13]\n REMOVE_TEMPS(n$2,n$3); [line 13]\n NULLIFY(&self,false); [line 13]\n APPLY_ABSTRACTION; [line 13]\n " shape="box"] +96 [label="96: Return Stmt \n n$1=*&self:class A * [line 13]\n n$2=*n$1._x:int [line 13]\n *&return:int =n$2 [line 13]\n REMOVE_TEMPS(n$1,n$2); [line 13]\n NULLIFY(&self,false); [line 13]\n APPLY_ABSTRACTION; [line 13]\n " shape="box"] 96 -> 95 ; @@ -243,7 +243,7 @@ digraph iCFG { 65 -> 70 ; -64 [label="64: Return Stmt \n n$1=*&target:class A * [line 32]\n n$0=_fun_A_x(n$1:class A *) virtual [line 32]\n *&return:int =n$0 [line 32]\n REMOVE_TEMPS(n$0,n$1); [line 32]\n NULLIFY(&target,false); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] +64 [label="64: Return Stmt \n n$0=*&target:class A * [line 32]\n n$3=_fun_A_x(n$0:class A *) virtual [line 32]\n *&return:int =n$3 [line 32]\n REMOVE_TEMPS(n$0,n$3); [line 32]\n NULLIFY(&target,false); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] 64 -> 60 ; @@ -349,7 +349,7 @@ digraph iCFG { 33 -> 38 ; -32 [label="32: Return Stmt \n n$18=*&a:class A * [line 25]\n n$17=_fun_A_x(n$18:class A *) virtual [line 25]\n *&return:int =n$17 [line 25]\n REMOVE_TEMPS(n$17,n$18); [line 25]\n NULLIFY(&a,false); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] +32 [label="32: Return Stmt \n n$17=*&a:class A * [line 25]\n n$20=_fun_A_x(n$17:class A *) virtual [line 25]\n *&return:int =n$20 [line 25]\n REMOVE_TEMPS(n$17,n$20); [line 25]\n NULLIFY(&a,false); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] 32 -> 28 ; @@ -444,7 +444,7 @@ digraph iCFG { 7 -> 12 ; -6 [label="6: Return Stmt \n n$1=*&target:class A * [line 20]\n n$0=_fun_A_x(n$1:class A *) virtual [line 20]\n *&return:int =n$0 [line 20]\n REMOVE_TEMPS(n$0,n$1); [line 20]\n NULLIFY(&target,false); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="box"] +6 [label="6: Return Stmt \n n$0=*&target:class A * [line 20]\n n$3=_fun_A_x(n$0:class A *) virtual [line 20]\n *&return:int =n$3 [line 20]\n REMOVE_TEMPS(n$0,n$3); [line 20]\n NULLIFY(&target,false); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="box"] 6 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot b/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot index 1e45a7609..7e4c1db5b 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot @@ -1,25 +1,25 @@ digraph iCFG { -52 [label="52: DeclStmt \n n$47=_fun___objc_alloc_no_fail(sizeof(class NSArray ):unsigned long ) [line 30]\n n$45=_fun_NSArray_init(n$47:class NSArray *) virtual [line 30]\n *&a:class NSArray *=n$45 [line 30]\n REMOVE_TEMPS(n$45,n$47); [line 30]\n " shape="box"] +52 [label="52: DeclStmt \n n$44=_fun___objc_alloc_no_fail(sizeof(class NSArray ):unsigned long ) [line 30]\n n$45=_fun_NSArray_init(n$44:class NSArray *) virtual [line 30]\n *&a:class NSArray *=n$45 [line 30]\n REMOVE_TEMPS(n$44,n$45); [line 30]\n " shape="box"] 52 -> 51 ; -51 [label="51: DeclStmt \n n$44=*&a:class NSArray * [line 32]\n *&objects:class NSArray *=n$44 [line 32]\n REMOVE_TEMPS(n$44); [line 32]\n NULLIFY(&a,false); [line 32]\n " shape="box"] +51 [label="51: DeclStmt \n n$43=*&a:class NSArray * [line 32]\n *&objects:class NSArray *=n$43 [line 32]\n REMOVE_TEMPS(n$43); [line 32]\n NULLIFY(&a,false); [line 32]\n " shape="box"] 51 -> 50 ; -50 [label="50: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_MyBlock_array_trans______2); [line 35]\n n$43=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_MyBlock_array_trans______2 ):unsigned long ) [line 35]\n *&__objc_anonymous_block_MyBlock_array_trans______2:class __objc_anonymous_block_MyBlock_array_trans______2 =n$43 [line 35]\n *&enumerateObjectsUsingBlock:_fn_ (*)=(_fun___objc_anonymous_block_MyBlock_array_trans______2) [line 35]\n REMOVE_TEMPS(n$43); [line 35]\n " shape="box"] +50 [label="50: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_MyBlock_array_trans______2); [line 35]\n n$42=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_MyBlock_array_trans______2 ):unsigned long ) [line 35]\n *&__objc_anonymous_block_MyBlock_array_trans______2:class __objc_anonymous_block_MyBlock_array_trans______2 =n$42 [line 35]\n *&enumerateObjectsUsingBlock:_fn_ (*)=(_fun___objc_anonymous_block_MyBlock_array_trans______2) [line 35]\n REMOVE_TEMPS(n$42); [line 35]\n " shape="box"] 50 -> 43 ; -49 [label="49: BinaryOperatorStmt: Assign \n NULLIFY(&ShouldStop,false); [line 40]\n n$42=*&stop:_Bool * [line 40]\n *n$42:_Bool =1 [line 40]\n REMOVE_TEMPS(n$42); [line 40]\n NULLIFY(&stop,false); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] +49 [label="49: BinaryOperatorStmt: Assign \n NULLIFY(&ShouldStop,false); [line 40]\n n$41=*&stop:_Bool * [line 40]\n *n$41:_Bool =1 [line 40]\n REMOVE_TEMPS(n$41); [line 40]\n NULLIFY(&stop,false); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] 49 -> 46 ; -48 [label="48: Prune (false branch) \n n$41=*&ShouldStop:int [line 39]\n PRUNE((n$41 == 0), false); [line 39]\n REMOVE_TEMPS(n$41); [line 39]\n APPLY_ABSTRACTION; [line 39]\n " shape="invhouse"] +48 [label="48: Prune (false branch) \n n$40=*&ShouldStop:int [line 39]\n PRUNE((n$40 == 0), false); [line 39]\n REMOVE_TEMPS(n$40); [line 39]\n APPLY_ABSTRACTION; [line 39]\n " shape="invhouse"] 48 -> 46 ; -47 [label="47: Prune (true branch) \n n$41=*&ShouldStop:int [line 39]\n PRUNE((n$41 != 0), true); [line 39]\n REMOVE_TEMPS(n$41); [line 39]\n " shape="invhouse"] +47 [label="47: Prune (true branch) \n n$40=*&ShouldStop:int [line 39]\n PRUNE((n$40 != 0), true); [line 39]\n REMOVE_TEMPS(n$40); [line 39]\n " shape="invhouse"] 47 -> 49 ; @@ -35,31 +35,31 @@ digraph iCFG { 44 -> 47 ; 44 -> 48 ; -43 [label="43: DeclStmt \n n$40=_fun_malloc_no_fail(sizeof(_Bool ):_Bool ) [line 43]\n *&stop:_Bool *=n$40 [line 43]\n REMOVE_TEMPS(n$40); [line 43]\n " shape="box"] +43 [label="43: DeclStmt \n n$39=_fun_malloc_no_fail(sizeof(_Bool ):_Bool ) [line 43]\n *&stop:_Bool *=n$39 [line 43]\n REMOVE_TEMPS(n$39); [line 43]\n " shape="box"] 43 -> 42 ; -42 [label="42: BinaryOperatorStmt: Assign \n n$39=*&stop:_Bool * [line 44]\n *n$39:_Bool =0 [line 44]\n REMOVE_TEMPS(n$39); [line 44]\n " shape="box"] +42 [label="42: BinaryOperatorStmt: Assign \n n$38=*&stop:_Bool * [line 44]\n *n$38:_Bool =0 [line 44]\n REMOVE_TEMPS(n$38); [line 44]\n " shape="box"] 42 -> 31 ; -41 [label="41: DeclStmt \n n$37=*&objects:class NSArray * [line 49]\n n$38=*&idx:unsigned long [line 49]\n n$36=_fun_NSArray_objectAtIndexedSubscript:(n$37:class NSArray *,n$38:unsigned long ) virtual [line 49]\n *&object:struct objc_object *=n$36 [line 49]\n REMOVE_TEMPS(n$36,n$37,n$38); [line 49]\n " shape="box"] +41 [label="41: DeclStmt \n n$35=*&objects:class NSArray * [line 49]\n n$36=*&idx:unsigned long [line 49]\n n$37=_fun_NSArray_objectAtIndexedSubscript:(n$35:class NSArray *,n$36:unsigned long ) virtual [line 49]\n *&object:struct objc_object *=n$37 [line 49]\n REMOVE_TEMPS(n$35,n$36,n$37); [line 49]\n " shape="box"] 41 -> 40 ; -40 [label="40: Call n$32 \n n$32=*&enumerateObjectsUsingBlock:_fn_ (*) [line 50]\n n$33=*&object:struct objc_object * [line 50]\n n$34=*&idx:unsigned long [line 50]\n n$35=*&stop:_Bool * [line 50]\n n$32(n$33:struct objc_object *,n$34:unsigned long ,n$35:_Bool *) [line 50]\n REMOVE_TEMPS(n$32,n$33,n$34,n$35); [line 50]\n NULLIFY(&object,false); [line 50]\n " shape="box"] +40 [label="40: Call n$31 \n n$31=*&enumerateObjectsUsingBlock:_fn_ (*) [line 50]\n n$32=*&object:struct objc_object * [line 50]\n n$33=*&idx:unsigned long [line 50]\n n$34=*&stop:_Bool * [line 50]\n n$31(n$32:struct objc_object *,n$33:unsigned long ,n$34:_Bool *) [line 50]\n REMOVE_TEMPS(n$31,n$32,n$33,n$34); [line 50]\n NULLIFY(&object,false); [line 50]\n " shape="box"] 40 -> 37 ; -39 [label="39: Prune (false branch) \n PRUNE(((n$31 == 1) == 0), false); [line 51]\n REMOVE_TEMPS(n$30,n$31); [line 51]\n " shape="invhouse"] +39 [label="39: Prune (false branch) \n PRUNE(((n$30 == 1) == 0), false); [line 51]\n REMOVE_TEMPS(n$29,n$30); [line 51]\n " shape="invhouse"] 39 -> 36 ; -38 [label="38: Prune (true branch) \n PRUNE(((n$31 == 1) != 0), true); [line 51]\n REMOVE_TEMPS(n$30,n$31); [line 51]\n APPLY_ABSTRACTION; [line 51]\n " shape="invhouse"] +38 [label="38: Prune (true branch) \n PRUNE(((n$30 == 1) != 0), true); [line 51]\n REMOVE_TEMPS(n$29,n$30); [line 51]\n APPLY_ABSTRACTION; [line 51]\n " shape="invhouse"] 38 -> 29 ; -37 [label="37: BinaryOperatorStmt: EQ \n n$30=*&stop:_Bool * [line 51]\n n$31=*n$30:_Bool [line 51]\n " shape="box"] +37 [label="37: BinaryOperatorStmt: EQ \n n$29=*&stop:_Bool * [line 51]\n n$30=*n$29:_Bool [line 51]\n " shape="box"] 37 -> 38 ; @@ -68,20 +68,20 @@ digraph iCFG { 36 -> 32 ; -35 [label="35: Prune (false branch) \n PRUNE(((n$27 < n$28) == 0), false); [line 46]\n REMOVE_TEMPS(n$27,n$28,n$29); [line 46]\n APPLY_ABSTRACTION; [line 46]\n " shape="invhouse"] +35 [label="35: Prune (false branch) \n PRUNE(((n$26 < n$28) == 0), false); [line 46]\n REMOVE_TEMPS(n$26,n$27,n$28); [line 46]\n APPLY_ABSTRACTION; [line 46]\n " shape="invhouse"] 35 -> 29 ; -34 [label="34: Prune (true branch) \n PRUNE(((n$27 < n$28) != 0), true); [line 46]\n REMOVE_TEMPS(n$27,n$28,n$29); [line 46]\n " shape="invhouse"] +34 [label="34: Prune (true branch) \n PRUNE(((n$26 < n$28) != 0), true); [line 46]\n REMOVE_TEMPS(n$26,n$27,n$28); [line 46]\n " shape="invhouse"] 34 -> 41 ; -33 [label="33: BinaryOperatorStmt: LT \n n$27=*&idx:unsigned long [line 46]\n n$29=*&objects:class NSArray * [line 46]\n n$28=_fun_NSArray_count(n$29:class NSArray *) virtual [line 46]\n " shape="box"] +33 [label="33: BinaryOperatorStmt: LT \n n$26=*&idx:unsigned long [line 46]\n n$27=*&objects:class NSArray * [line 46]\n n$28=_fun_NSArray_count(n$27:class NSArray *) virtual [line 46]\n " shape="box"] 33 -> 34 ; 33 -> 35 ; -32 [label="32: UnaryOperator \n n$26=*&idx:unsigned long [line 46]\n *&idx:unsigned long =(n$26 + 1) [line 46]\n REMOVE_TEMPS(n$26); [line 46]\n APPLY_ABSTRACTION; [line 46]\n " shape="box"] +32 [label="32: UnaryOperator \n n$25=*&idx:unsigned long [line 46]\n *&idx:unsigned long =(n$25 + 1) [line 46]\n REMOVE_TEMPS(n$25); [line 46]\n APPLY_ABSTRACTION; [line 46]\n " shape="box"] 32 -> 30 ; @@ -93,7 +93,7 @@ digraph iCFG { 30 -> 33 ; -29 [label="29: Call _fun_free \n NULLIFY(&enumerateObjectsUsingBlock,false); [line 53]\n NULLIFY(&idx,false); [line 53]\n NULLIFY(&objects,false); [line 53]\n n$25=*&stop:_Bool * [line 53]\n _fun_free(n$25:void *) [line 53]\n REMOVE_TEMPS(n$25); [line 53]\n NULLIFY(&__objc_anonymous_block_MyBlock_array_trans______2,true); [line 53]\n NULLIFY(&stop,false); [line 53]\n APPLY_ABSTRACTION; [line 53]\n " shape="box"] +29 [label="29: Call _fun_free \n NULLIFY(&enumerateObjectsUsingBlock,false); [line 53]\n NULLIFY(&idx,false); [line 53]\n NULLIFY(&objects,false); [line 53]\n n$24=*&stop:_Bool * [line 53]\n _fun_free(n$24:void *) [line 53]\n REMOVE_TEMPS(n$24); [line 53]\n NULLIFY(&__objc_anonymous_block_MyBlock_array_trans______2,true); [line 53]\n NULLIFY(&stop,false); [line 53]\n APPLY_ABSTRACTION; [line 53]\n " shape="box"] 29 -> 28 ; @@ -104,7 +104,7 @@ digraph iCFG { 27 -> 52 ; -26 [label="26: DeclStmt \n n$24=_fun___objc_alloc_no_fail(sizeof(class NSArray ):unsigned long ) [line 14]\n n$22=_fun_NSArray_init(n$24:class NSArray *) virtual [line 14]\n *&a:class NSArray *=n$22 [line 14]\n REMOVE_TEMPS(n$22,n$24); [line 14]\n " shape="box"] +26 [label="26: DeclStmt \n n$22=_fun___objc_alloc_no_fail(sizeof(class NSArray ):unsigned long ) [line 14]\n n$23=_fun_NSArray_init(n$22:class NSArray *) virtual [line 14]\n *&a:class NSArray *=n$23 [line 14]\n REMOVE_TEMPS(n$22,n$23); [line 14]\n " shape="box"] 26 -> 25 ; @@ -148,7 +148,7 @@ digraph iCFG { 16 -> 5 ; -15 [label="15: DeclStmt \n n$14=*&objects:class NSArray * [line 15]\n n$15=*&idx:unsigned long [line 15]\n n$13=_fun_NSArray_objectAtIndexedSubscript:(n$14:class NSArray *,n$15:unsigned long ) virtual [line 15]\n *&object:struct objc_object *=n$13 [line 15]\n REMOVE_TEMPS(n$13,n$14,n$15); [line 15]\n NULLIFY(&object,false); [line 15]\n " shape="box"] +15 [label="15: DeclStmt \n n$13=*&objects:class NSArray * [line 15]\n n$14=*&idx:unsigned long [line 15]\n n$15=_fun_NSArray_objectAtIndexedSubscript:(n$13:class NSArray *,n$14:unsigned long ) virtual [line 15]\n *&object:struct objc_object *=n$15 [line 15]\n REMOVE_TEMPS(n$13,n$14,n$15); [line 15]\n NULLIFY(&object,false); [line 15]\n " shape="box"] 15 -> 14 ; @@ -173,15 +173,15 @@ digraph iCFG { 10 -> 6 ; -9 [label="9: Prune (false branch) \n PRUNE(((n$3 < n$4) == 0), false); [line 15]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="invhouse"] +9 [label="9: Prune (false branch) \n PRUNE(((n$3 < n$5) == 0), false); [line 15]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="invhouse"] 9 -> 3 ; -8 [label="8: Prune (true branch) \n PRUNE(((n$3 < n$4) != 0), true); [line 15]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 15]\n " shape="invhouse"] +8 [label="8: Prune (true branch) \n PRUNE(((n$3 < n$5) != 0), true); [line 15]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 15]\n " shape="invhouse"] 8 -> 15 ; -7 [label="7: BinaryOperatorStmt: LT \n n$3=*&idx:unsigned long [line 15]\n n$5=*&objects:class NSArray * [line 15]\n n$4=_fun_NSArray_count(n$5:class NSArray *) virtual [line 15]\n " shape="box"] +7 [label="7: BinaryOperatorStmt: LT \n n$3=*&idx:unsigned long [line 15]\n n$4=*&objects:class NSArray * [line 15]\n n$5=_fun_NSArray_count(n$4:class NSArray *) virtual [line 15]\n " shape="box"] 7 -> 8 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot index 2dc6353b8..7727e755a 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot @@ -39,7 +39,7 @@ digraph iCFG { 23 -> 32 ; -22 [label="22: BinaryOperatorStmt: Assign \n n$17=*&self:class A * [line 14]\n n$18=*&x:int [line 14]\n *n$17._x:int =n$18 [line 14]\n REMOVE_TEMPS(n$17,n$18); [line 14]\n NULLIFY(&self,false); [line 14]\n NULLIFY(&x,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] +22 [label="22: BinaryOperatorStmt: Assign \n n$15=*&self:class A * [line 14]\n n$16=*&x:int [line 14]\n *n$15._x:int =n$16 [line 14]\n REMOVE_TEMPS(n$15,n$16); [line 14]\n NULLIFY(&self,false); [line 14]\n NULLIFY(&x,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] 22 -> 21 ; @@ -50,7 +50,7 @@ digraph iCFG { 20 -> 22 ; -19 [label="19: Return Stmt \n n$15=*&self:class A * [line 14]\n n$16=*n$15._x:int [line 14]\n *&return:int =n$16 [line 14]\n REMOVE_TEMPS(n$15,n$16); [line 14]\n NULLIFY(&self,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] +19 [label="19: Return Stmt \n n$13=*&self:class A * [line 14]\n n$14=*n$13._x:int [line 14]\n *&return:int =n$14 [line 14]\n REMOVE_TEMPS(n$13,n$14); [line 14]\n NULLIFY(&self,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] 19 -> 18 ; @@ -61,11 +61,11 @@ digraph iCFG { 17 -> 19 ; -16 [label="16: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_trans______2); [line 36]\n n$13=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_trans______2 ):unsigned long ) [line 36]\n *&__objc_anonymous_block_A_trans______2:class __objc_anonymous_block_A_trans______2 =n$13 [line 36]\n n$14=*&#GB$A_trans_sharedInstance:struct objc_object * [line 36]\n *n$13.A_trans_sharedInstance:struct objc_object *=n$14 [line 36]\n *&dummy_block:_fn_ (*)=(_fun___objc_anonymous_block_A_trans______2) [line 36]\n REMOVE_TEMPS(n$13,n$14); [line 36]\n " shape="box"] +16 [label="16: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_trans______2); [line 36]\n n$11=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_trans______2 ):unsigned long ) [line 36]\n *&__objc_anonymous_block_A_trans______2:class __objc_anonymous_block_A_trans______2 =n$11 [line 36]\n n$12=*&#GB$A_trans_sharedInstance:struct objc_object * [line 36]\n *n$11.A_trans_sharedInstance:struct objc_object *=n$12 [line 36]\n *&dummy_block:_fn_ (*)=(_fun___objc_anonymous_block_A_trans______2) [line 36]\n REMOVE_TEMPS(n$11,n$12); [line 36]\n " shape="box"] 16 -> 12 ; -15 [label="15: BinaryOperatorStmt: Assign \n n$12=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 37]\n n$10=_fun_A_init(n$12:class A *) virtual [line 37]\n *&#GB$A_trans_sharedInstance:struct objc_object *=n$10 [line 37]\n REMOVE_TEMPS(n$10,n$12); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +15 [label="15: BinaryOperatorStmt: Assign \n n$9=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 37]\n n$10=_fun_A_init(n$9:class A *) virtual [line 37]\n *&#GB$A_trans_sharedInstance:struct objc_object *=n$10 [line 37]\n REMOVE_TEMPS(n$9,n$10); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] 15 -> 14 ; @@ -76,11 +76,11 @@ digraph iCFG { 13 -> 15 ; -12 [label="12: Call n$9 \n n$9=*&dummy_block:_fn_ (*) [line 39]\n n$9() [line 39]\n REMOVE_TEMPS(n$9); [line 39]\n NULLIFY(&dummy_block,false); [line 39]\n " shape="box"] +12 [label="12: Call n$8 \n n$8=*&dummy_block:_fn_ (*) [line 39]\n n$8() [line 39]\n REMOVE_TEMPS(n$8); [line 39]\n NULLIFY(&dummy_block,false); [line 39]\n " shape="box"] 12 -> 11 ; -11 [label="11: Return Stmt \n n$8=*&#GB$A_trans_sharedInstance:struct objc_object * [line 40]\n *&return:struct objc_object *=n$8 [line 40]\n REMOVE_TEMPS(n$8); [line 40]\n NULLIFY(&__objc_anonymous_block_A_trans______2,true); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] +11 [label="11: Return Stmt \n n$7=*&#GB$A_trans_sharedInstance:struct objc_object * [line 40]\n *&return:struct objc_object *=n$7 [line 40]\n REMOVE_TEMPS(n$7); [line 40]\n NULLIFY(&__objc_anonymous_block_A_trans______2,true); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] 11 -> 10 ; @@ -91,11 +91,11 @@ digraph iCFG { 9 -> 16 ; -8 [label="8: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_sharedInstance______1); [line 27]\n n$6=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_sharedInstance______1 ):unsigned long ) [line 27]\n *&__objc_anonymous_block_A_sharedInstance______1:class __objc_anonymous_block_A_sharedInstance______1 =n$6 [line 27]\n n$7=*&#GB$A_sharedInstance_sharedInstance:struct objc_object * [line 27]\n *n$6.A_sharedInstance_sharedInstance:struct objc_object *=n$7 [line 27]\n *&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*)=(_fun___objc_anonymous_block_A_sharedInstance______1) [line 29]\n REMOVE_TEMPS(n$6,n$7); [line 29]\n " shape="box"] +8 [label="8: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_sharedInstance______1); [line 27]\n n$5=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_sharedInstance______1 ):unsigned long ) [line 27]\n *&__objc_anonymous_block_A_sharedInstance______1:class __objc_anonymous_block_A_sharedInstance______1 =n$5 [line 27]\n n$6=*&#GB$A_sharedInstance_sharedInstance:struct objc_object * [line 27]\n *n$5.A_sharedInstance_sharedInstance:struct objc_object *=n$6 [line 27]\n *&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*)=(_fun___objc_anonymous_block_A_sharedInstance______1) [line 29]\n REMOVE_TEMPS(n$5,n$6); [line 29]\n " shape="box"] 8 -> 4 ; -7 [label="7: BinaryOperatorStmt: Assign \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 28]\n n$3=_fun_A_init(n$5:class A *) virtual [line 28]\n *&#GB$A_sharedInstance_sharedInstance:struct objc_object *=n$3 [line 28]\n REMOVE_TEMPS(n$3,n$5); [line 28]\n APPLY_ABSTRACTION; [line 28]\n " shape="box"] +7 [label="7: BinaryOperatorStmt: Assign \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 28]\n n$4=_fun_A_init(n$3:class A *) virtual [line 28]\n *&#GB$A_sharedInstance_sharedInstance:struct objc_object *=n$4 [line 28]\n REMOVE_TEMPS(n$3,n$4); [line 28]\n APPLY_ABSTRACTION; [line 28]\n " shape="box"] 7 -> 6 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot index d53e3eb91..5999973ab 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot @@ -3,15 +3,15 @@ digraph iCFG { 60 -> 59 ; -59 [label="59: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_barrier_example______6); [line 70]\n n$58=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_barrier_example______6 ):unsigned long ) [line 70]\n *&__objc_anonymous_block_A_dispatch_barrier_example______6:class __objc_anonymous_block_A_dispatch_barrier_example______6 =n$58 [line 70]\n n$59=*&#GB$A_dispatch_barrier_example_a:class A * [line 70]\n *n$58.A_dispatch_barrier_example_a:class A *=n$59 [line 70]\n *&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_barrier_example______6) [line 70]\n REMOVE_TEMPS(n$58,n$59); [line 70]\n " shape="box"] +59 [label="59: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_barrier_example______6); [line 70]\n n$52=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_barrier_example______6 ):unsigned long ) [line 70]\n *&__objc_anonymous_block_A_dispatch_barrier_example______6:class __objc_anonymous_block_A_dispatch_barrier_example______6 =n$52 [line 70]\n n$53=*&#GB$A_dispatch_barrier_example_a:class A * [line 70]\n *n$52.A_dispatch_barrier_example_a:class A *=n$53 [line 70]\n *&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_barrier_example______6) [line 70]\n REMOVE_TEMPS(n$52,n$53); [line 70]\n " shape="box"] 59 -> 54 ; -58 [label="58: BinaryOperatorStmt: Assign \n n$57=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 71]\n n$55=_fun_NSObject_init(n$57:class A *) virtual [line 71]\n *&#GB$A_dispatch_barrier_example_a:class A *=n$55 [line 71]\n REMOVE_TEMPS(n$55,n$57); [line 71]\n " shape="box"] +58 [label="58: BinaryOperatorStmt: Assign \n n$50=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 71]\n n$51=_fun_NSObject_init(n$50:class A *) virtual [line 71]\n *&#GB$A_dispatch_barrier_example_a:class A *=n$51 [line 71]\n REMOVE_TEMPS(n$50,n$51); [line 71]\n " shape="box"] 58 -> 57 ; -57 [label="57: BinaryOperatorStmt: Assign \n n$54=*&#GB$A_dispatch_barrier_example_a:class A * [line 72]\n *n$54.x:int =10 [line 72]\n REMOVE_TEMPS(n$54); [line 72]\n APPLY_ABSTRACTION; [line 72]\n " shape="box"] +57 [label="57: BinaryOperatorStmt: Assign \n n$49=*&#GB$A_dispatch_barrier_example_a:class A * [line 72]\n *n$49.x:int =10 [line 72]\n REMOVE_TEMPS(n$49); [line 72]\n APPLY_ABSTRACTION; [line 72]\n " shape="box"] 57 -> 56 ; @@ -22,11 +22,11 @@ digraph iCFG { 55 -> 58 ; -54 [label="54: Call n$52 \n n$52=*&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*) [line 70]\n n$53=n$52() [line 70]\n REMOVE_TEMPS(n$52,n$53); [line 70]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_barrier_example______6,false); [line 70]\n " shape="box"] +54 [label="54: Call n$47 \n n$47=*&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*) [line 70]\n n$48=n$47() [line 70]\n REMOVE_TEMPS(n$47,n$48); [line 70]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_barrier_example______6,false); [line 70]\n " shape="box"] 54 -> 53 ; -53 [label="53: Return Stmt \n n$50=*&#GB$A_dispatch_barrier_example_a:class A * [line 74]\n n$51=*n$50.x:int [line 74]\n *&return:int =n$51 [line 74]\n REMOVE_TEMPS(n$50,n$51); [line 74]\n NULLIFY(&__objc_anonymous_block_A_dispatch_barrier_example______6,true); [line 74]\n APPLY_ABSTRACTION; [line 74]\n " shape="box"] +53 [label="53: Return Stmt \n n$45=*&#GB$A_dispatch_barrier_example_a:class A * [line 74]\n n$46=*n$45.x:int [line 74]\n *&return:int =n$46 [line 74]\n REMOVE_TEMPS(n$45,n$46); [line 74]\n NULLIFY(&__objc_anonymous_block_A_dispatch_barrier_example______6,true); [line 74]\n APPLY_ABSTRACTION; [line 74]\n " shape="box"] 53 -> 52 ; @@ -41,15 +41,15 @@ digraph iCFG { 50 -> 49 ; -49 [label="49: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_notify_example______5); [line 61]\n n$48=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_notify_example______5 ):unsigned long ) [line 61]\n *&__objc_anonymous_block_A_dispatch_group_notify_example______5:class __objc_anonymous_block_A_dispatch_group_notify_example______5 =n$48 [line 61]\n n$49=*&#GB$A_dispatch_group_notify_example_a:class A * [line 61]\n *n$48.A_dispatch_group_notify_example_a:class A *=n$49 [line 61]\n *&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_notify_example______5) [line 61]\n REMOVE_TEMPS(n$48,n$49); [line 61]\n " shape="box"] +49 [label="49: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_notify_example______5); [line 61]\n n$43=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_notify_example______5 ):unsigned long ) [line 61]\n *&__objc_anonymous_block_A_dispatch_group_notify_example______5:class __objc_anonymous_block_A_dispatch_group_notify_example______5 =n$43 [line 61]\n n$44=*&#GB$A_dispatch_group_notify_example_a:class A * [line 61]\n *n$43.A_dispatch_group_notify_example_a:class A *=n$44 [line 61]\n *&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_notify_example______5) [line 61]\n REMOVE_TEMPS(n$43,n$44); [line 61]\n " shape="box"] 49 -> 44 ; -48 [label="48: BinaryOperatorStmt: Assign \n n$47=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 62]\n n$45=_fun_NSObject_init(n$47:class A *) virtual [line 62]\n *&#GB$A_dispatch_group_notify_example_a:class A *=n$45 [line 62]\n REMOVE_TEMPS(n$45,n$47); [line 62]\n " shape="box"] +48 [label="48: BinaryOperatorStmt: Assign \n n$41=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 62]\n n$42=_fun_NSObject_init(n$41:class A *) virtual [line 62]\n *&#GB$A_dispatch_group_notify_example_a:class A *=n$42 [line 62]\n REMOVE_TEMPS(n$41,n$42); [line 62]\n " shape="box"] 48 -> 47 ; -47 [label="47: BinaryOperatorStmt: Assign \n n$44=*&#GB$A_dispatch_group_notify_example_a:class A * [line 63]\n *n$44.x:int =10 [line 63]\n REMOVE_TEMPS(n$44); [line 63]\n APPLY_ABSTRACTION; [line 63]\n " shape="box"] +47 [label="47: BinaryOperatorStmt: Assign \n n$40=*&#GB$A_dispatch_group_notify_example_a:class A * [line 63]\n *n$40.x:int =10 [line 63]\n REMOVE_TEMPS(n$40); [line 63]\n APPLY_ABSTRACTION; [line 63]\n " shape="box"] 47 -> 46 ; @@ -60,11 +60,11 @@ digraph iCFG { 45 -> 48 ; -44 [label="44: Call n$42 \n n$42=*&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*) [line 61]\n n$43=n$42() [line 61]\n REMOVE_TEMPS(n$42,n$43); [line 61]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_group_notify_example______5,false); [line 61]\n " shape="box"] +44 [label="44: Call n$38 \n n$38=*&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*) [line 61]\n n$39=n$38() [line 61]\n REMOVE_TEMPS(n$38,n$39); [line 61]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_group_notify_example______5,false); [line 61]\n " shape="box"] 44 -> 43 ; -43 [label="43: Return Stmt \n n$40=*&#GB$A_dispatch_group_notify_example_a:class A * [line 65]\n n$41=*n$40.x:int [line 65]\n *&return:int =n$41 [line 65]\n REMOVE_TEMPS(n$40,n$41); [line 65]\n NULLIFY(&__objc_anonymous_block_A_dispatch_group_notify_example______5,true); [line 65]\n APPLY_ABSTRACTION; [line 65]\n " shape="box"] +43 [label="43: Return Stmt \n n$36=*&#GB$A_dispatch_group_notify_example_a:class A * [line 65]\n n$37=*n$36.x:int [line 65]\n *&return:int =n$37 [line 65]\n REMOVE_TEMPS(n$36,n$37); [line 65]\n NULLIFY(&__objc_anonymous_block_A_dispatch_group_notify_example______5,true); [line 65]\n APPLY_ABSTRACTION; [line 65]\n " shape="box"] 43 -> 42 ; @@ -79,15 +79,15 @@ digraph iCFG { 40 -> 39 ; -39 [label="39: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_example______4); [line 52]\n n$38=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_example______4 ):unsigned long ) [line 52]\n *&__objc_anonymous_block_A_dispatch_group_example______4:class __objc_anonymous_block_A_dispatch_group_example______4 =n$38 [line 52]\n n$39=*&#GB$A_dispatch_group_example_a:class A * [line 52]\n *n$38.A_dispatch_group_example_a:class A *=n$39 [line 52]\n *&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_example______4) [line 52]\n REMOVE_TEMPS(n$38,n$39); [line 52]\n " shape="box"] +39 [label="39: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_example______4); [line 52]\n n$34=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_example______4 ):unsigned long ) [line 52]\n *&__objc_anonymous_block_A_dispatch_group_example______4:class __objc_anonymous_block_A_dispatch_group_example______4 =n$34 [line 52]\n n$35=*&#GB$A_dispatch_group_example_a:class A * [line 52]\n *n$34.A_dispatch_group_example_a:class A *=n$35 [line 52]\n *&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_example______4) [line 52]\n REMOVE_TEMPS(n$34,n$35); [line 52]\n " shape="box"] 39 -> 34 ; -38 [label="38: BinaryOperatorStmt: Assign \n n$37=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 53]\n n$35=_fun_NSObject_init(n$37:class A *) virtual [line 53]\n *&#GB$A_dispatch_group_example_a:class A *=n$35 [line 53]\n REMOVE_TEMPS(n$35,n$37); [line 53]\n " shape="box"] +38 [label="38: BinaryOperatorStmt: Assign \n n$32=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 53]\n n$33=_fun_NSObject_init(n$32:class A *) virtual [line 53]\n *&#GB$A_dispatch_group_example_a:class A *=n$33 [line 53]\n REMOVE_TEMPS(n$32,n$33); [line 53]\n " shape="box"] 38 -> 37 ; -37 [label="37: BinaryOperatorStmt: Assign \n n$34=*&#GB$A_dispatch_group_example_a:class A * [line 54]\n *n$34.x:int =10 [line 54]\n REMOVE_TEMPS(n$34); [line 54]\n APPLY_ABSTRACTION; [line 54]\n " shape="box"] +37 [label="37: BinaryOperatorStmt: Assign \n n$31=*&#GB$A_dispatch_group_example_a:class A * [line 54]\n *n$31.x:int =10 [line 54]\n REMOVE_TEMPS(n$31); [line 54]\n APPLY_ABSTRACTION; [line 54]\n " shape="box"] 37 -> 36 ; @@ -98,11 +98,11 @@ digraph iCFG { 35 -> 38 ; -34 [label="34: Call n$32 \n n$32=*&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*) [line 52]\n n$33=n$32() [line 52]\n REMOVE_TEMPS(n$32,n$33); [line 52]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_group_example______4,false); [line 52]\n " shape="box"] +34 [label="34: Call n$29 \n n$29=*&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*) [line 52]\n n$30=n$29() [line 52]\n REMOVE_TEMPS(n$29,n$30); [line 52]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_group_example______4,false); [line 52]\n " shape="box"] 34 -> 33 ; -33 [label="33: Return Stmt \n n$30=*&#GB$A_dispatch_group_example_a:class A * [line 56]\n n$31=*n$30.x:int [line 56]\n *&return:int =n$31 [line 56]\n REMOVE_TEMPS(n$30,n$31); [line 56]\n NULLIFY(&__objc_anonymous_block_A_dispatch_group_example______4,true); [line 56]\n APPLY_ABSTRACTION; [line 56]\n " shape="box"] +33 [label="33: Return Stmt \n n$27=*&#GB$A_dispatch_group_example_a:class A * [line 56]\n n$28=*n$27.x:int [line 56]\n *&return:int =n$28 [line 56]\n REMOVE_TEMPS(n$27,n$28); [line 56]\n NULLIFY(&__objc_anonymous_block_A_dispatch_group_example______4,true); [line 56]\n APPLY_ABSTRACTION; [line 56]\n " shape="box"] 33 -> 32 ; @@ -117,15 +117,15 @@ digraph iCFG { 30 -> 29 ; -29 [label="29: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_after_example______3); [line 43]\n n$28=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_after_example______3 ):unsigned long ) [line 43]\n *&__objc_anonymous_block_A_dispatch_after_example______3:class __objc_anonymous_block_A_dispatch_after_example______3 =n$28 [line 43]\n n$29=*&#GB$A_dispatch_after_example_a:class A * [line 43]\n *n$28.A_dispatch_after_example_a:class A *=n$29 [line 43]\n *&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_after_example______3) [line 42]\n REMOVE_TEMPS(n$28,n$29); [line 42]\n " shape="box"] +29 [label="29: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_after_example______3); [line 43]\n n$25=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_after_example______3 ):unsigned long ) [line 43]\n *&__objc_anonymous_block_A_dispatch_after_example______3:class __objc_anonymous_block_A_dispatch_after_example______3 =n$25 [line 43]\n n$26=*&#GB$A_dispatch_after_example_a:class A * [line 43]\n *n$25.A_dispatch_after_example_a:class A *=n$26 [line 43]\n *&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_after_example______3) [line 42]\n REMOVE_TEMPS(n$25,n$26); [line 42]\n " shape="box"] 29 -> 24 ; -28 [label="28: BinaryOperatorStmt: Assign \n n$27=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 44]\n n$25=_fun_NSObject_init(n$27:class A *) virtual [line 44]\n *&#GB$A_dispatch_after_example_a:class A *=n$25 [line 44]\n REMOVE_TEMPS(n$25,n$27); [line 44]\n " shape="box"] +28 [label="28: BinaryOperatorStmt: Assign \n n$23=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 44]\n n$24=_fun_NSObject_init(n$23:class A *) virtual [line 44]\n *&#GB$A_dispatch_after_example_a:class A *=n$24 [line 44]\n REMOVE_TEMPS(n$23,n$24); [line 44]\n " shape="box"] 28 -> 27 ; -27 [label="27: BinaryOperatorStmt: Assign \n n$24=*&#GB$A_dispatch_after_example_a:class A * [line 45]\n *n$24.x:int =10 [line 45]\n REMOVE_TEMPS(n$24); [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] +27 [label="27: BinaryOperatorStmt: Assign \n n$22=*&#GB$A_dispatch_after_example_a:class A * [line 45]\n *n$22.x:int =10 [line 45]\n REMOVE_TEMPS(n$22); [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] 27 -> 26 ; @@ -136,11 +136,11 @@ digraph iCFG { 25 -> 28 ; -24 [label="24: Call n$22 \n n$22=*&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*) [line 42]\n n$23=n$22() [line 42]\n REMOVE_TEMPS(n$22,n$23); [line 42]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_after_example______3,false); [line 42]\n " shape="box"] +24 [label="24: Call n$20 \n n$20=*&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*) [line 42]\n n$21=n$20() [line 42]\n REMOVE_TEMPS(n$20,n$21); [line 42]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_after_example______3,false); [line 42]\n " shape="box"] 24 -> 23 ; -23 [label="23: Return Stmt \n n$20=*&#GB$A_dispatch_after_example_a:class A * [line 47]\n n$21=*n$20.x:int [line 47]\n *&return:int =n$21 [line 47]\n REMOVE_TEMPS(n$20,n$21); [line 47]\n NULLIFY(&__objc_anonymous_block_A_dispatch_after_example______3,true); [line 47]\n APPLY_ABSTRACTION; [line 47]\n " shape="box"] +23 [label="23: Return Stmt \n n$18=*&#GB$A_dispatch_after_example_a:class A * [line 47]\n n$19=*n$18.x:int [line 47]\n *&return:int =n$19 [line 47]\n REMOVE_TEMPS(n$18,n$19); [line 47]\n NULLIFY(&__objc_anonymous_block_A_dispatch_after_example______3,true); [line 47]\n APPLY_ABSTRACTION; [line 47]\n " shape="box"] 23 -> 22 ; @@ -155,15 +155,15 @@ digraph iCFG { 20 -> 19 ; -19 [label="19: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_async_example______2); [line 33]\n n$18=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_async_example______2 ):unsigned long ) [line 33]\n *&__objc_anonymous_block_A_dispatch_async_example______2:class __objc_anonymous_block_A_dispatch_async_example______2 =n$18 [line 33]\n n$19=*&#GB$A_dispatch_async_example_a:class A * [line 33]\n *n$18.A_dispatch_async_example_a:class A *=n$19 [line 33]\n *&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_async_example______2) [line 33]\n REMOVE_TEMPS(n$18,n$19); [line 33]\n " shape="box"] +19 [label="19: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_async_example______2); [line 33]\n n$16=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_async_example______2 ):unsigned long ) [line 33]\n *&__objc_anonymous_block_A_dispatch_async_example______2:class __objc_anonymous_block_A_dispatch_async_example______2 =n$16 [line 33]\n n$17=*&#GB$A_dispatch_async_example_a:class A * [line 33]\n *n$16.A_dispatch_async_example_a:class A *=n$17 [line 33]\n *&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_async_example______2) [line 33]\n REMOVE_TEMPS(n$16,n$17); [line 33]\n " shape="box"] 19 -> 14 ; -18 [label="18: BinaryOperatorStmt: Assign \n n$17=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 34]\n n$15=_fun_NSObject_init(n$17:class A *) virtual [line 34]\n *&#GB$A_dispatch_async_example_a:class A *=n$15 [line 34]\n REMOVE_TEMPS(n$15,n$17); [line 34]\n " shape="box"] +18 [label="18: BinaryOperatorStmt: Assign \n n$14=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 34]\n n$15=_fun_NSObject_init(n$14:class A *) virtual [line 34]\n *&#GB$A_dispatch_async_example_a:class A *=n$15 [line 34]\n REMOVE_TEMPS(n$14,n$15); [line 34]\n " shape="box"] 18 -> 17 ; -17 [label="17: BinaryOperatorStmt: Assign \n n$14=*&#GB$A_dispatch_async_example_a:class A * [line 35]\n *n$14.x:int =10 [line 35]\n REMOVE_TEMPS(n$14); [line 35]\n APPLY_ABSTRACTION; [line 35]\n " shape="box"] +17 [label="17: BinaryOperatorStmt: Assign \n n$13=*&#GB$A_dispatch_async_example_a:class A * [line 35]\n *n$13.x:int =10 [line 35]\n REMOVE_TEMPS(n$13); [line 35]\n APPLY_ABSTRACTION; [line 35]\n " shape="box"] 17 -> 16 ; @@ -174,11 +174,11 @@ digraph iCFG { 15 -> 18 ; -14 [label="14: Call n$12 \n n$12=*&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*) [line 33]\n n$13=n$12() [line 33]\n REMOVE_TEMPS(n$12,n$13); [line 33]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_async_example______2,false); [line 33]\n " shape="box"] +14 [label="14: Call n$11 \n n$11=*&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*) [line 33]\n n$12=n$11() [line 33]\n REMOVE_TEMPS(n$11,n$12); [line 33]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_async_example______2,false); [line 33]\n " shape="box"] 14 -> 13 ; -13 [label="13: Return Stmt \n n$10=*&#GB$A_dispatch_async_example_a:class A * [line 37]\n n$11=*n$10.x:int [line 37]\n *&return:int =n$11 [line 37]\n REMOVE_TEMPS(n$10,n$11); [line 37]\n NULLIFY(&__objc_anonymous_block_A_dispatch_async_example______2,true); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +13 [label="13: Return Stmt \n n$9=*&#GB$A_dispatch_async_example_a:class A * [line 37]\n n$10=*n$9.x:int [line 37]\n *&return:int =n$10 [line 37]\n REMOVE_TEMPS(n$9,n$10); [line 37]\n NULLIFY(&__objc_anonymous_block_A_dispatch_async_example______2,true); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] 13 -> 12 ; @@ -193,11 +193,11 @@ digraph iCFG { 10 -> 9 ; -9 [label="9: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_once_example______1); [line 24]\n n$8=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_once_example______1 ):unsigned long ) [line 24]\n *&__objc_anonymous_block_A_dispatch_once_example______1:class __objc_anonymous_block_A_dispatch_once_example______1 =n$8 [line 24]\n n$9=*&#GB$A_dispatch_once_example_a:class A * [line 24]\n *n$8.A_dispatch_once_example_a:class A *=n$9 [line 24]\n *&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_once_example______1) [line 23]\n REMOVE_TEMPS(n$8,n$9); [line 23]\n " shape="box"] +9 [label="9: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_once_example______1); [line 24]\n n$7=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_once_example______1 ):unsigned long ) [line 24]\n *&__objc_anonymous_block_A_dispatch_once_example______1:class __objc_anonymous_block_A_dispatch_once_example______1 =n$7 [line 24]\n n$8=*&#GB$A_dispatch_once_example_a:class A * [line 24]\n *n$7.A_dispatch_once_example_a:class A *=n$8 [line 24]\n *&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_once_example______1) [line 23]\n REMOVE_TEMPS(n$7,n$8); [line 23]\n " shape="box"] 9 -> 4 ; -8 [label="8: BinaryOperatorStmt: Assign \n n$7=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 25]\n n$5=_fun_NSObject_init(n$7:class A *) virtual [line 25]\n *&#GB$A_dispatch_once_example_a:class A *=n$5 [line 25]\n REMOVE_TEMPS(n$5,n$7); [line 25]\n " shape="box"] +8 [label="8: BinaryOperatorStmt: Assign \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 25]\n n$6=_fun_NSObject_init(n$5:class A *) virtual [line 25]\n *&#GB$A_dispatch_once_example_a:class A *=n$6 [line 25]\n REMOVE_TEMPS(n$5,n$6); [line 25]\n " shape="box"] 8 -> 7 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot b/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot index f38eef540..f00840b45 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/retain_cycle.dot @@ -1,5 +1,5 @@ digraph iCFG { -19 [label="19: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 68]\n *&a:class A *=n$3 [line 68]\n REMOVE_TEMPS(n$3); [line 68]\n " shape="box"] +19 [label="19: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 68]\n *&a:class A *=n$2 [line 68]\n REMOVE_TEMPS(n$2); [line 68]\n " shape="box"] 19 -> 18 ; @@ -33,7 +33,7 @@ digraph iCFG { 11 -> 14 ; -10 [label="10: BinaryOperatorStmt: Assign \n n$8=*&self:class A * [line 50]\n n$10=_fun___objc_alloc_no_fail(sizeof(class B ):unsigned long ) [line 50]\n *n$8._b:class B *=n$10 [line 50]\n REMOVE_TEMPS(n$8,n$10); [line 50]\n " shape="box"] +10 [label="10: BinaryOperatorStmt: Assign \n n$8=*&self:class A * [line 50]\n n$9=_fun___objc_alloc_no_fail(sizeof(class B ):unsigned long ) [line 50]\n *n$8._b:class B *=n$9 [line 50]\n REMOVE_TEMPS(n$8,n$9); [line 50]\n " shape="box"] 10 -> 9 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/block/static.dot b/infer/tests/codetoanalyze/objc/frontend/block/static.dot index 2115f2beb..40700eba0 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/static.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/static.dot @@ -10,11 +10,11 @@ digraph iCFG { 29 -> 31 ; -28 [label="28: Call (_fun___objc_anonymous_block_A_test3______4) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test3______4); [line 59]\n n$20=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test3______4 ):unsigned long ) [line 59]\n *&__objc_anonymous_block_A_test3______4:class __objc_anonymous_block_A_test3______4 =n$20 [line 59]\n n$21=*&#GB$A_test3_i:int [line 59]\n *n$20.A_test3_i:int =n$21 [line 59]\n (_fun___objc_anonymous_block_A_test3______4)() [line 59]\n REMOVE_TEMPS(n$20,n$21); [line 59]\n " shape="box"] +28 [label="28: Call (_fun___objc_anonymous_block_A_test3______4) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test3______4); [line 59]\n n$17=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test3______4 ):unsigned long ) [line 59]\n *&__objc_anonymous_block_A_test3______4:class __objc_anonymous_block_A_test3______4 =n$17 [line 59]\n n$18=*&#GB$A_test3_i:int [line 59]\n *n$17.A_test3_i:int =n$18 [line 59]\n (_fun___objc_anonymous_block_A_test3______4)() [line 59]\n REMOVE_TEMPS(n$17,n$18); [line 59]\n " shape="box"] 28 -> 24 ; -27 [label="27: UnaryOperator \n n$19=*&#GB$A_test3_i:int [line 61]\n *&#GB$A_test3_i:int =(n$19 + 1) [line 61]\n REMOVE_TEMPS(n$19); [line 61]\n APPLY_ABSTRACTION; [line 61]\n " shape="box"] +27 [label="27: UnaryOperator \n n$16=*&#GB$A_test3_i:int [line 61]\n *&#GB$A_test3_i:int =(n$16 + 1) [line 61]\n REMOVE_TEMPS(n$16); [line 61]\n APPLY_ABSTRACTION; [line 61]\n " shape="box"] 27 -> 26 ; @@ -25,7 +25,7 @@ digraph iCFG { 25 -> 27 ; -24 [label="24: Return Stmt \n n$18=*&#GB$A_test3_i:int [line 64]\n *&return:int =n$18 [line 64]\n REMOVE_TEMPS(n$18); [line 64]\n NULLIFY(&__objc_anonymous_block_A_test3______4,true); [line 64]\n APPLY_ABSTRACTION; [line 64]\n " shape="box"] +24 [label="24: Return Stmt \n n$15=*&#GB$A_test3_i:int [line 64]\n *&return:int =n$15 [line 64]\n REMOVE_TEMPS(n$15); [line 64]\n NULLIFY(&__objc_anonymous_block_A_test3______4,true); [line 64]\n APPLY_ABSTRACTION; [line 64]\n " shape="box"] 24 -> 23 ; @@ -36,15 +36,15 @@ digraph iCFG { 22 -> 28 ; -21 [label="21: BinaryOperatorStmt: Assign \n n$17=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 43]\n n$15=_fun_A_init(n$17:class A *) virtual [line 43]\n *&#GB$A_test2_sharedInstance:struct objc_object *=n$15 [line 43]\n REMOVE_TEMPS(n$15,n$17); [line 43]\n " shape="box"] +21 [label="21: BinaryOperatorStmt: Assign \n n$13=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 43]\n n$14=_fun_A_init(n$13:class A *) virtual [line 43]\n *&#GB$A_test2_sharedInstance:struct objc_object *=n$14 [line 43]\n REMOVE_TEMPS(n$13,n$14); [line 43]\n " shape="box"] 21 -> 20 ; -20 [label="20: Call (_fun___objc_anonymous_block_A_test2______3) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test2______3); [line 44]\n n$13=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test2______3 ):unsigned long ) [line 44]\n *&__objc_anonymous_block_A_test2______3:class __objc_anonymous_block_A_test2______3 =n$13 [line 44]\n n$14=*&#GB$A_test2_sharedInstance:struct objc_object * [line 44]\n *n$13.A_test2_sharedInstance:struct objc_object *=n$14 [line 44]\n (_fun___objc_anonymous_block_A_test2______3)() [line 44]\n REMOVE_TEMPS(n$13,n$14); [line 44]\n " shape="box"] +20 [label="20: Call (_fun___objc_anonymous_block_A_test2______3) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test2______3); [line 44]\n n$11=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test2______3 ):unsigned long ) [line 44]\n *&__objc_anonymous_block_A_test2______3:class __objc_anonymous_block_A_test2______3 =n$11 [line 44]\n n$12=*&#GB$A_test2_sharedInstance:struct objc_object * [line 44]\n *n$11.A_test2_sharedInstance:struct objc_object *=n$12 [line 44]\n (_fun___objc_anonymous_block_A_test2______3)() [line 44]\n REMOVE_TEMPS(n$11,n$12); [line 44]\n " shape="box"] 20 -> 16 ; -19 [label="19: DeclStmt \n n$12=*&#GB$A_test2_sharedInstance:struct objc_object * [line 46]\n *&p:struct objc_object *=n$12 [line 46]\n REMOVE_TEMPS(n$12); [line 46]\n NULLIFY(&p,false); [line 46]\n APPLY_ABSTRACTION; [line 46]\n " shape="box"] +19 [label="19: DeclStmt \n n$10=*&#GB$A_test2_sharedInstance:struct objc_object * [line 46]\n *&p:struct objc_object *=n$10 [line 46]\n REMOVE_TEMPS(n$10); [line 46]\n NULLIFY(&p,false); [line 46]\n APPLY_ABSTRACTION; [line 46]\n " shape="box"] 19 -> 18 ; @@ -55,7 +55,7 @@ digraph iCFG { 17 -> 19 ; -16 [label="16: Return Stmt \n n$11=*&#GB$A_test2_sharedInstance:struct objc_object * [line 49]\n *&return:struct objc_object *=n$11 [line 49]\n REMOVE_TEMPS(n$11); [line 49]\n NULLIFY(&__objc_anonymous_block_A_test2______3,true); [line 49]\n APPLY_ABSTRACTION; [line 49]\n " shape="box"] +16 [label="16: Return Stmt \n n$9=*&#GB$A_test2_sharedInstance:struct objc_object * [line 49]\n *&return:struct objc_object *=n$9 [line 49]\n REMOVE_TEMPS(n$9); [line 49]\n NULLIFY(&__objc_anonymous_block_A_test2______3,true); [line 49]\n APPLY_ABSTRACTION; [line 49]\n " shape="box"] 16 -> 15 ; @@ -66,11 +66,11 @@ digraph iCFG { 14 -> 21 ; -13 [label="13: Call (_fun___objc_anonymous_block_A_test_leak______2) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test_leak______2); [line 32]\n n$9=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test_leak______2 ):unsigned long ) [line 32]\n *&__objc_anonymous_block_A_test_leak______2:class __objc_anonymous_block_A_test_leak______2 =n$9 [line 32]\n n$10=*&#GB$A_test_leak_sharedInstance:struct objc_object * [line 32]\n *n$9.A_test_leak_sharedInstance:struct objc_object *=n$10 [line 32]\n (_fun___objc_anonymous_block_A_test_leak______2)() [line 32]\n REMOVE_TEMPS(n$9,n$10); [line 32]\n NULLIFY(&__objc_anonymous_block_A_test_leak______2,true); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] +13 [label="13: Call (_fun___objc_anonymous_block_A_test_leak______2) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test_leak______2); [line 32]\n n$7=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test_leak______2 ):unsigned long ) [line 32]\n *&__objc_anonymous_block_A_test_leak______2:class __objc_anonymous_block_A_test_leak______2 =n$7 [line 32]\n n$8=*&#GB$A_test_leak_sharedInstance:struct objc_object * [line 32]\n *n$7.A_test_leak_sharedInstance:struct objc_object *=n$8 [line 32]\n (_fun___objc_anonymous_block_A_test_leak______2)() [line 32]\n REMOVE_TEMPS(n$7,n$8); [line 32]\n NULLIFY(&__objc_anonymous_block_A_test_leak______2,true); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] 13 -> 9 ; -12 [label="12: BinaryOperatorStmt: Assign \n n$8=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 33]\n n$6=_fun_A_init(n$8:class A *) virtual [line 33]\n *&#GB$A_test_leak_sharedInstance:struct objc_object *=n$6 [line 33]\n REMOVE_TEMPS(n$6,n$8); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] +12 [label="12: BinaryOperatorStmt: Assign \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 33]\n n$6=_fun_A_init(n$5:class A *) virtual [line 33]\n *&#GB$A_test_leak_sharedInstance:struct objc_object *=n$6 [line 33]\n REMOVE_TEMPS(n$5,n$6); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] 12 -> 11 ; @@ -88,11 +88,11 @@ digraph iCFG { 8 -> 13 ; -7 [label="7: Call (_fun___objc_anonymous_block_A_test______1) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test______1); [line 21]\n n$4=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test______1 ):unsigned long ) [line 21]\n *&__objc_anonymous_block_A_test______1:class __objc_anonymous_block_A_test______1 =n$4 [line 21]\n n$5=*&#GB$A_test_sharedInstance:struct objc_object * [line 21]\n *n$4.A_test_sharedInstance:struct objc_object *=n$5 [line 21]\n (_fun___objc_anonymous_block_A_test______1)() [line 21]\n REMOVE_TEMPS(n$4,n$5); [line 21]\n " shape="box"] +7 [label="7: Call (_fun___objc_anonymous_block_A_test______1) \n DECLARE_LOCALS(&__objc_anonymous_block_A_test______1); [line 21]\n n$3=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_test______1 ):unsigned long ) [line 21]\n *&__objc_anonymous_block_A_test______1:class __objc_anonymous_block_A_test______1 =n$3 [line 21]\n n$4=*&#GB$A_test_sharedInstance:struct objc_object * [line 21]\n *n$3.A_test_sharedInstance:struct objc_object *=n$4 [line 21]\n (_fun___objc_anonymous_block_A_test______1)() [line 21]\n REMOVE_TEMPS(n$3,n$4); [line 21]\n " shape="box"] 7 -> 3 ; -6 [label="6: BinaryOperatorStmt: Assign \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 22]\n n$1=_fun_A_init(n$3:class A *) virtual [line 22]\n *&#GB$A_test_sharedInstance:struct objc_object *=n$1 [line 22]\n REMOVE_TEMPS(n$1,n$3); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] +6 [label="6: BinaryOperatorStmt: Assign \n n$1=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 22]\n n$2=_fun_A_init(n$1:class A *) virtual [line 22]\n *&#GB$A_test_sharedInstance:struct objc_object *=n$2 [line 22]\n REMOVE_TEMPS(n$1,n$2); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] 6 -> 5 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.dot index 476e394e5..f68e9ff9b 100644 --- a/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.dot +++ b/infer/tests/codetoanalyze/objc/frontend/boxing/Boxing.dot @@ -1,5 +1,5 @@ digraph iCFG { -26 [label="26: DeclStmt \n n$16=_fun_strdup(\"hello world\":char *) [line 42]\n n$15=_fun_NSString_stringWithUTF8String:(n$16:char *) [line 42]\n *&s:class NSString *=n$15 [line 42]\n REMOVE_TEMPS(n$15,n$16); [line 42]\n NULLIFY(&s,false); [line 42]\n " shape="box"] +26 [label="26: DeclStmt \n n$15=_fun_strdup(\"hello world\":char *) [line 42]\n n$16=_fun_NSString_stringWithUTF8String:(n$15:char *) [line 42]\n *&s:class NSString *=n$16 [line 42]\n REMOVE_TEMPS(n$15,n$16); [line 42]\n NULLIFY(&s,false); [line 42]\n " shape="box"] 26 -> 25 ; @@ -82,11 +82,11 @@ digraph iCFG { 5 -> 4 ; -4 [label="4: DeclStmt \n n$4=*&x:int [line 17]\n n$5=*&y:int [line 17]\n n$3=_fun_NSNumber_numberWithInt:((n$4 + n$5):int ) [line 17]\n *&n:class NSNumber *=n$3 [line 17]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 17]\n NULLIFY(&n,false); [line 17]\n " shape="box"] +4 [label="4: DeclStmt \n n$3=*&x:int [line 17]\n n$4=*&y:int [line 17]\n n$5=_fun_NSNumber_numberWithInt:((n$3 + n$4):int ) [line 17]\n *&n:class NSNumber *=n$5 [line 17]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 17]\n NULLIFY(&n,false); [line 17]\n " shape="box"] 4 -> 3 ; -3 [label="3: Return Stmt \n n$1=*&x:int [line 18]\n n$2=*&y:int [line 18]\n n$0=_fun_NSNumber_numberWithInt:((n$1 + n$2):int ) [line 18]\n *&return:class NSNumber *=n$0 [line 18]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 18]\n NULLIFY(&x,false); [line 18]\n NULLIFY(&y,false); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] +3 [label="3: Return Stmt \n n$0=*&x:int [line 18]\n n$1=*&y:int [line 18]\n n$2=_fun_NSNumber_numberWithInt:((n$0 + n$1):int ) [line 18]\n *&return:class NSNumber *=n$2 [line 18]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 18]\n NULLIFY(&x,false); [line 18]\n NULLIFY(&y,false); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/array.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/array.dot index b554ba3d0..76749b048 100644 --- a/infer/tests/codetoanalyze/objc/frontend/boxing/array.dot +++ b/infer/tests/codetoanalyze/objc/frontend/boxing/array.dot @@ -1,13 +1,13 @@ digraph iCFG { -12 [label="12: DeclStmt \n n$10=_fun_NSString_stringWithUTF8String:(\"Mercedes-Benz\":char *) [line 18]\n n$11=_fun_NSString_stringWithUTF8String:(\"BMW\":char *) [line 18]\n n$12=_fun_NSString_stringWithUTF8String:(\"Porsche\":char *) [line 18]\n n$13=_fun_NSString_stringWithUTF8String:(\"Opel\":char *) [line 19]\n n$14=_fun_NSString_stringWithUTF8String:(\"Volkswagen\":char *) [line 19]\n n$15=_fun_NSString_stringWithUTF8String:(\"Audi\":char *) [line 19]\n n$9=_fun_NSArray_arrayWithObjects:count:(n$10:struct objc_object *,n$11:struct objc_object *,n$12:struct objc_object *,n$13:struct objc_object *,n$14:struct objc_object *,n$15:struct objc_object *,0:struct objc_object *) [line 18]\n *&germanCars:class NSArray *=n$9 [line 18]\n REMOVE_TEMPS(n$9,n$10,n$11,n$12,n$13,n$14,n$15); [line 18]\n " shape="box"] +12 [label="12: DeclStmt \n n$9=_fun_NSString_stringWithUTF8String:(\"Mercedes-Benz\":char *) [line 18]\n n$10=_fun_NSString_stringWithUTF8String:(\"BMW\":char *) [line 18]\n n$11=_fun_NSString_stringWithUTF8String:(\"Porsche\":char *) [line 18]\n n$12=_fun_NSString_stringWithUTF8String:(\"Opel\":char *) [line 19]\n n$13=_fun_NSString_stringWithUTF8String:(\"Volkswagen\":char *) [line 19]\n n$14=_fun_NSString_stringWithUTF8String:(\"Audi\":char *) [line 19]\n n$15=_fun_NSArray_arrayWithObjects:count:(n$9:struct objc_object *,n$10:struct objc_object *,n$11:struct objc_object *,n$12:struct objc_object *,n$13:struct objc_object *,n$14:struct objc_object *,0:struct objc_object *) [line 18]\n *&germanCars:class NSArray *=n$15 [line 18]\n REMOVE_TEMPS(n$9,n$10,n$11,n$12,n$13,n$14,n$15); [line 18]\n " shape="box"] 12 -> 11 ; -11 [label="11: BinaryOperatorStmt: Assign \n n$8=*&germanCars:class NSArray * [line 20]\n n$7=_fun_NSArray_objectAtIndexedSubscript:(n$8:class NSArray *,3:unsigned long ) virtual [line 20]\n *&s:class NSString *=n$7 [line 20]\n REMOVE_TEMPS(n$7,n$8); [line 20]\n NULLIFY(&s,false); [line 20]\n " shape="box"] +11 [label="11: BinaryOperatorStmt: Assign \n n$7=*&germanCars:class NSArray * [line 20]\n n$8=_fun_NSArray_objectAtIndexedSubscript:(n$7:class NSArray *,3:unsigned long ) virtual [line 20]\n *&s:class NSString *=n$8 [line 20]\n REMOVE_TEMPS(n$7,n$8); [line 20]\n NULLIFY(&s,false); [line 20]\n " shape="box"] 11 -> 10 ; -10 [label="10: BinaryOperatorStmt: Assign \n n$6=*&germanCars:class NSArray * [line 22]\n n$5=_fun_NSArray_nextObject(n$6:class NSArray *) virtual [line 22]\n *&item:class NSString *=n$5 [line 22]\n REMOVE_TEMPS(n$5,n$6); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] +10 [label="10: BinaryOperatorStmt: Assign \n n$5=*&germanCars:class NSArray * [line 22]\n n$6=_fun_NSArray_nextObject(n$5:class NSArray *) virtual [line 22]\n *&item:class NSString *=n$6 [line 22]\n REMOVE_TEMPS(n$5,n$6); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] 10 -> 4 ; @@ -15,7 +15,7 @@ digraph iCFG { 9 -> 8 ; -8 [label="8: BinaryOperatorStmt: Assign \n n$2=*&germanCars:class NSArray * [line 22]\n n$1=_fun_NSArray_nextObject(n$2:class NSArray *) virtual [line 22]\n *&item:class NSString *=n$1 [line 22]\n REMOVE_TEMPS(n$1,n$2); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] +8 [label="8: BinaryOperatorStmt: Assign \n n$1=*&germanCars:class NSArray * [line 22]\n n$2=_fun_NSArray_nextObject(n$1:class NSArray *) virtual [line 22]\n *&item:class NSString *=n$2 [line 22]\n REMOVE_TEMPS(n$1,n$2); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] 8 -> 4 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.dot index e504d244c..07f1669ed 100644 --- a/infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.dot +++ b/infer/tests/codetoanalyze/objc/frontend/boxing/array_literal.dot @@ -1,9 +1,9 @@ digraph iCFG { -4 [label="4: DeclStmt \n n$4=_fun_NSString_stringWithUTF8String:(\"cat\":char *) [line 13]\n n$5=_fun_NSString_stringWithUTF8String:(\"dog\":char *) [line 13]\n n$3=_fun_NSArray_arrayWithObjects:(n$4:struct objc_object *,n$5:class NSString *,0:void *) [line 13]\n *&animals:class NSArray *=n$3 [line 13]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 13]\n NULLIFY(&animals,false); [line 13]\n " shape="box"] +4 [label="4: DeclStmt \n n$3=_fun_NSString_stringWithUTF8String:(\"cat\":char *) [line 13]\n n$4=_fun_NSString_stringWithUTF8String:(\"dog\":char *) [line 13]\n n$5=_fun_NSArray_arrayWithObjects:(n$3:struct objc_object *,n$4:class NSString *,0:void *) [line 13]\n *&animals:class NSArray *=n$5 [line 13]\n REMOVE_TEMPS(n$3,n$4,n$5); [line 13]\n NULLIFY(&animals,false); [line 13]\n " shape="box"] 4 -> 3 ; -3 [label="3: Return Stmt \n n$1=_fun_NSString_stringWithUTF8String:(\"cat\":char *) [line 14]\n n$2=_fun_NSString_stringWithUTF8String:(\"dog\":char *) [line 14]\n n$0=_fun_NSArray_arrayWithObjects:count:(n$1:struct objc_object *,n$2:struct objc_object *,0:struct objc_object *) [line 14]\n *&return:class NSArray *=n$0 [line 14]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] +3 [label="3: Return Stmt \n n$0=_fun_NSString_stringWithUTF8String:(\"cat\":char *) [line 14]\n n$1=_fun_NSString_stringWithUTF8String:(\"dog\":char *) [line 14]\n n$2=_fun_NSArray_arrayWithObjects:count:(n$0:struct objc_object *,n$1:struct objc_object *,0:struct objc_object *) [line 14]\n *&return:class NSArray *=n$2 [line 14]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.dot b/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.dot index b9f8c389c..be0dbab1d 100644 --- a/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.dot +++ b/infer/tests/codetoanalyze/objc/frontend/boxing/dict_literal.dot @@ -1,5 +1,5 @@ digraph iCFG { -6 [label="6: Return Stmt \n n$1=_fun_NSString_stringWithUTF8String:(\"Matt\":char *) [line 23]\n n$2=_fun_NSString_stringWithUTF8String:(\"firstName\":char *) [line 23]\n n$3=_fun_NSString_stringWithUTF8String:(\"Galloway\":char *) [line 23]\n n$4=_fun_NSString_stringWithUTF8String:(\"lastName\":char *) [line 23]\n n$5=_fun_NSNumber_numberWithInt:(28:int ) [line 23]\n n$6=_fun_NSString_stringWithUTF8String:(\"age\":char *) [line 23]\n n$0=_fun_NSDictionary___objc_dictionary_literal:(n$1:struct objc_object *,n$2:struct objc_object *,n$3:struct objc_object *,n$4:struct objc_object *,n$5:struct objc_object *,n$6:struct objc_object *,0:struct objc_object *) [line 23]\n *&return:class NSDictionary *=n$0 [line 23]\n REMOVE_TEMPS(n$0,n$1,n$2,n$3,n$4,n$5,n$6); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] +6 [label="6: Return Stmt \n n$0=_fun_NSString_stringWithUTF8String:(\"Matt\":char *) [line 23]\n n$1=_fun_NSString_stringWithUTF8String:(\"firstName\":char *) [line 23]\n n$2=_fun_NSString_stringWithUTF8String:(\"Galloway\":char *) [line 23]\n n$3=_fun_NSString_stringWithUTF8String:(\"lastName\":char *) [line 23]\n n$4=_fun_NSNumber_numberWithInt:(28:int ) [line 23]\n n$5=_fun_NSString_stringWithUTF8String:(\"age\":char *) [line 23]\n n$6=_fun_NSDictionary___objc_dictionary_literal:(n$0:struct objc_object *,n$1:struct objc_object *,n$2:struct objc_object *,n$3:struct objc_object *,n$4:struct objc_object *,n$5:struct objc_object *,0:struct objc_object *) [line 23]\n *&return:class NSDictionary *=n$6 [line 23]\n REMOVE_TEMPS(n$0,n$1,n$2,n$3,n$4,n$5,n$6); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] 6 -> 5 ; @@ -10,7 +10,7 @@ digraph iCFG { 4 -> 6 ; -3 [label="3: Return Stmt \n n$1=_fun_NSString_stringWithUTF8String:(\"Matt\":char *) [line 17]\n n$2=_fun_NSString_stringWithUTF8String:(\"firstName\":char *) [line 17]\n n$3=_fun_NSString_stringWithUTF8String:(\"Galloway\":char *) [line 17]\n n$4=_fun_NSString_stringWithUTF8String:(\"lastName\":char *) [line 17]\n n$5=_fun_NSNumber_numberWithInt:(28:int ) [line 18]\n n$6=_fun_NSString_stringWithUTF8String:(\"age\":char *) [line 18]\n n$0=_fun_NSDictionary_dictionaryWithObjectsAndKeys:(n$1:struct objc_object *,n$2:class NSString *,n$3:class NSString *,n$4:class NSString *,n$5:class NSNumber *,n$6:class NSString *,0:void *) [line 16]\n *&return:class NSDictionary *=n$0 [line 16]\n REMOVE_TEMPS(n$0,n$1,n$2,n$3,n$4,n$5,n$6); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] +3 [label="3: Return Stmt \n n$0=_fun_NSString_stringWithUTF8String:(\"Matt\":char *) [line 17]\n n$1=_fun_NSString_stringWithUTF8String:(\"firstName\":char *) [line 17]\n n$2=_fun_NSString_stringWithUTF8String:(\"Galloway\":char *) [line 17]\n n$3=_fun_NSString_stringWithUTF8String:(\"lastName\":char *) [line 17]\n n$4=_fun_NSNumber_numberWithInt:(28:int ) [line 18]\n n$5=_fun_NSString_stringWithUTF8String:(\"age\":char *) [line 18]\n n$6=_fun_NSDictionary_dictionaryWithObjectsAndKeys:(n$0:struct objc_object *,n$1:class NSString *,n$2:class NSString *,n$3:class NSString *,n$4:class NSNumber *,n$5:class NSString *,0:void *) [line 16]\n *&return:class NSDictionary *=n$6 [line 16]\n REMOVE_TEMPS(n$0,n$1,n$2,n$3,n$4,n$5,n$6); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot index f73847720..0bc48d951 100644 --- a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot +++ b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot @@ -1,5 +1,5 @@ digraph iCFG { -11 [label="11: Return Stmt \n n$2=*&self:class A * [line 24]\n n$5=*&SIL_temp_conditional___6:int [line 24]\n NULLIFY(&SIL_temp_conditional___6,true); [line 24]\n n$1=_fun_A_test4:(n$2:class A *,n$5:int ) virtual [line 24]\n *&return:int =n$1 [line 24]\n REMOVE_TEMPS(n$1,n$2,n$5); [line 24]\n NULLIFY(&self,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +11 [label="11: Return Stmt \n n$1=*&self:class A * [line 24]\n n$4=*&SIL_temp_conditional___6:int [line 24]\n NULLIFY(&SIL_temp_conditional___6,true); [line 24]\n n$5=_fun_A_test4:(n$1:class A *,n$4:int ) virtual [line 24]\n *&return:int =n$5 [line 24]\n REMOVE_TEMPS(n$1,n$4,n$5); [line 24]\n NULLIFY(&self,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] 11 -> 5 ; @@ -7,15 +7,15 @@ digraph iCFG { 10 -> 6 ; -9 [label="9: ConditinalStmt Branch \n n$4=*&b:_Bool [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___6); [line 24]\n *&SIL_temp_conditional___6:int =n$4 [line 24]\n REMOVE_TEMPS(n$4); [line 24]\n NULLIFY(&b,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +9 [label="9: ConditinalStmt Branch \n n$3=*&b:_Bool [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___6); [line 24]\n *&SIL_temp_conditional___6:int =n$3 [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n NULLIFY(&b,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] 9 -> 6 ; -8 [label="8: Prune (false branch) \n n$3=*&b:_Bool [line 24]\n PRUNE((n$3 == 0), false); [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n " shape="invhouse"] +8 [label="8: Prune (false branch) \n n$2=*&b:_Bool [line 24]\n PRUNE((n$2 == 0), false); [line 24]\n REMOVE_TEMPS(n$2); [line 24]\n " shape="invhouse"] 8 -> 10 ; -7 [label="7: Prune (true branch) \n n$3=*&b:_Bool [line 24]\n PRUNE((n$3 != 0), true); [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n " shape="invhouse"] +7 [label="7: Prune (true branch) \n n$2=*&b:_Bool [line 24]\n PRUNE((n$2 != 0), true); [line 24]\n REMOVE_TEMPS(n$2); [line 24]\n " shape="invhouse"] 7 -> 9 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot index 5da098488..f69765457 100644 --- a/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot +++ b/infer/tests/codetoanalyze/objc/frontend/exceptions/ExceptionExample.dot @@ -1,18 +1,18 @@ digraph iCFG { -11 [label="11: DeclStmt \n n$9=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 31]\n *&s:class NSString *=n$9 [line 31]\n REMOVE_TEMPS(n$9); [line 31]\n " shape="box"] +11 [label="11: DeclStmt \n n$7=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 31]\n *&s:class NSString *=n$7 [line 31]\n REMOVE_TEMPS(n$7); [line 31]\n " shape="box"] 11 -> 8 ; 11 -> 9 ; -10 [label="10: Return Stmt \n NULLIFY(&s,false); [line 33]\n n$6=_fun_NSString_stringWithUTF8String:(\"Something is not right exception\":char *) [line 33]\n n$7=_fun_NSString_stringWithUTF8String:(\"Can't perform this operation because of this or that\":char *) [line 34]\n n$5=_fun_NSException_exceptionWithName:reason:userInfo:(n$6:class NSString *,n$7:class NSString *,0:class NSDictionary *) [line 33]\n *&return:void =n$5 [line 33]\n REMOVE_TEMPS(n$5,n$6,n$7); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] +10 [label="10: Return Stmt \n NULLIFY(&s,false); [line 33]\n n$4=_fun_NSString_stringWithUTF8String:(\"Something is not right exception\":char *) [line 33]\n n$5=_fun_NSString_stringWithUTF8String:(\"Can't perform this operation because of this or that\":char *) [line 34]\n n$6=_fun_NSException_exceptionWithName:reason:userInfo:(n$4:class NSString *,n$5:class NSString *,0:class NSDictionary *) [line 33]\n *&return:void =n$6 [line 33]\n REMOVE_TEMPS(n$4,n$5,n$6); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] 10 -> 6 ; -9 [label="9: Prune (false branch) \n n$4=*&s:class NSString * [line 32]\n PRUNE((n$4 == 0), false); [line 32]\n REMOVE_TEMPS(n$4); [line 32]\n " shape="invhouse"] +9 [label="9: Prune (false branch) \n n$3=*&s:class NSString * [line 32]\n PRUNE((n$3 == 0), false); [line 32]\n REMOVE_TEMPS(n$3); [line 32]\n " shape="invhouse"] 9 -> 7 ; -8 [label="8: Prune (true branch) \n n$4=*&s:class NSString * [line 32]\n PRUNE((n$4 != 0), true); [line 32]\n REMOVE_TEMPS(n$4); [line 32]\n " shape="invhouse"] +8 [label="8: Prune (true branch) \n n$3=*&s:class NSString * [line 32]\n PRUNE((n$3 != 0), true); [line 32]\n REMOVE_TEMPS(n$3); [line 32]\n " shape="invhouse"] 8 -> 10 ; @@ -27,11 +27,11 @@ digraph iCFG { 5 -> 11 ; -4 [label="4: DeclStmt \n n$3=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 21]\n *&s:class NSString *=n$3 [line 21]\n REMOVE_TEMPS(n$3); [line 21]\n NULLIFY(&s,false); [line 21]\n " shape="box"] +4 [label="4: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class NSString ):unsigned long ) [line 21]\n *&s:class NSString *=n$2 [line 21]\n REMOVE_TEMPS(n$2); [line 21]\n NULLIFY(&s,false); [line 21]\n " shape="box"] 4 -> 3 ; -3 [label="3: Message Call: description \n n$1=*&self:class ExceptionExample * [line 26]\n n$0=_fun_ExceptionExample_description(n$1:class ExceptionExample *) virtual [line 26]\n REMOVE_TEMPS(n$0,n$1); [line 26]\n NULLIFY(&self,false); [line 26]\n APPLY_ABSTRACTION; [line 26]\n " shape="box"] +3 [label="3: Message Call: description \n n$0=*&self:class ExceptionExample * [line 26]\n n$1=_fun_ExceptionExample_description(n$0:class ExceptionExample *) virtual [line 26]\n REMOVE_TEMPS(n$0,n$1); [line 26]\n NULLIFY(&self,false); [line 26]\n APPLY_ABSTRACTION; [line 26]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot index e42dbb11f..437e2459a 100644 --- a/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot +++ b/infer/tests/codetoanalyze/objc/frontend/fast_enumeration/Fast_enumeration.dot @@ -7,7 +7,7 @@ digraph iCFG { 20 -> 15 ; -19 [label="19: ComppoundAssignStmt \n n$14=*&item:class NSArray * [line 29]\n n$13=_fun_NSArray_count(n$14:class NSArray *) virtual [line 29]\n n$15=*&size:int [line 29]\n *&size:int =(n$15 + n$13) [line 29]\n REMOVE_TEMPS(n$13,n$14,n$15); [line 29]\n NULLIFY(&item,false); [line 29]\n APPLY_ABSTRACTION; [line 29]\n " shape="box"] +19 [label="19: ComppoundAssignStmt \n n$13=*&item:class NSArray * [line 29]\n n$14=_fun_NSArray_count(n$13:class NSArray *) virtual [line 29]\n n$15=*&size:int [line 29]\n *&size:int =(n$15 + n$14) [line 29]\n REMOVE_TEMPS(n$13,n$14,n$15); [line 29]\n NULLIFY(&item,false); [line 29]\n APPLY_ABSTRACTION; [line 29]\n " shape="box"] 19 -> 15 ; @@ -19,7 +19,7 @@ digraph iCFG { 17 -> 19 ; -16 [label="16: BinaryOperatorStmt: Assign \n n$11=*&items:class NSArray * [line 28]\n n$10=_fun_NSArray_nextObject(n$11:class NSArray *) virtual [line 28]\n *&item:class NSArray *=n$10 [line 28]\n n$12=*&item:class NSArray * [line 28]\n " shape="box"] +16 [label="16: BinaryOperatorStmt: Assign \n n$10=*&items:class NSArray * [line 28]\n n$11=_fun_NSArray_nextObject(n$10:class NSArray *) virtual [line 28]\n *&item:class NSArray *=n$11 [line 28]\n n$12=*&item:class NSArray * [line 28]\n " shape="box"] 16 -> 17 ; @@ -43,15 +43,15 @@ digraph iCFG { 11 -> 10 ; -10 [label="10: BinaryOperatorStmt: Assign \n n$8=*&items:class NSArray * [line 19]\n n$7=_fun_NSArray_nextObject(n$8:class NSArray *) virtual [line 19]\n *&item:class NSArray *=n$7 [line 19]\n REMOVE_TEMPS(n$7,n$8); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] +10 [label="10: BinaryOperatorStmt: Assign \n n$7=*&items:class NSArray * [line 19]\n n$8=_fun_NSArray_nextObject(n$7:class NSArray *) virtual [line 19]\n *&item:class NSArray *=n$8 [line 19]\n REMOVE_TEMPS(n$7,n$8); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] 10 -> 4 ; -9 [label="9: ComppoundAssignStmt \n n$5=*&item:class NSArray * [line 20]\n n$4=_fun_NSArray_count(n$5:class NSArray *) virtual [line 20]\n n$6=*&size:int [line 20]\n *&size:int =(n$6 + n$4) [line 20]\n REMOVE_TEMPS(n$4,n$5,n$6); [line 20]\n NULLIFY(&item,false); [line 20]\n " shape="box"] +9 [label="9: ComppoundAssignStmt \n n$4=*&item:class NSArray * [line 20]\n n$5=_fun_NSArray_count(n$4:class NSArray *) virtual [line 20]\n n$6=*&size:int [line 20]\n *&size:int =(n$6 + n$5) [line 20]\n REMOVE_TEMPS(n$4,n$5,n$6); [line 20]\n NULLIFY(&item,false); [line 20]\n " shape="box"] 9 -> 8 ; -8 [label="8: BinaryOperatorStmt: Assign \n n$3=*&items:class NSArray * [line 19]\n n$2=_fun_NSArray_nextObject(n$3:class NSArray *) virtual [line 19]\n *&item:class NSArray *=n$2 [line 19]\n REMOVE_TEMPS(n$2,n$3); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] +8 [label="8: BinaryOperatorStmt: Assign \n n$2=*&items:class NSArray * [line 19]\n n$3=_fun_NSArray_nextObject(n$2:class NSArray *) virtual [line 19]\n *&item:class NSArray *=n$3 [line 19]\n REMOVE_TEMPS(n$2,n$3); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] 8 -> 4 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot b/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot index 4068248fa..f365130b9 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/PropertyAttributes.dot @@ -1,5 +1,5 @@ digraph iCFG { -39 [label="39: DeclStmt \n n$7=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 39]\n n$5=_fun_NSObject_init(n$7:class A *) virtual [line 39]\n *&a:class A *=n$5 [line 39]\n REMOVE_TEMPS(n$5,n$7); [line 39]\n " shape="box"] +39 [label="39: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 39]\n n$6=_fun_NSObject_init(n$5:class A *) virtual [line 39]\n *&a:class A *=n$6 [line 39]\n REMOVE_TEMPS(n$5,n$6); [line 39]\n " shape="box"] 39 -> 38 ; @@ -33,7 +33,7 @@ digraph iCFG { 31 -> 39 ; -27 [label="27: Return Stmt \n n$28=*&self:class A * [line 18]\n n$29=*n$28._last_name:class A * [line 18]\n *&return:class A *=n$29 [line 18]\n REMOVE_TEMPS(n$28,n$29); [line 18]\n NULLIFY(&self,false); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] +27 [label="27: Return Stmt \n n$27=*&self:class A * [line 18]\n n$28=*n$27._last_name:class A * [line 18]\n *&return:class A *=n$28 [line 18]\n REMOVE_TEMPS(n$27,n$28); [line 18]\n NULLIFY(&self,false); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] 27 -> 26 ; @@ -44,15 +44,15 @@ digraph iCFG { 25 -> 27 ; -24 [label="24: Message Call: retain \n n$27=*&name:class A * [line 16]\n n$26=_fun___objc_retain(n$27:class A *) [line 16]\n REMOVE_TEMPS(n$26,n$27); [line 16]\n " shape="box"] +24 [label="24: Message Call: retain \n n$25=*&name:class A * [line 16]\n n$26=_fun___objc_retain(n$25:class A *) [line 16]\n REMOVE_TEMPS(n$25,n$26); [line 16]\n " shape="box"] 24 -> 23 ; -23 [label="23: Message Call: release \n n$24=*&self:class A * [line 16]\n n$25=*n$24._name:class A * [line 16]\n n$23=_fun___objc_release(n$25:class A *) [line 16]\n REMOVE_TEMPS(n$23,n$24,n$25); [line 16]\n " shape="box"] +23 [label="23: Message Call: release \n n$22=*&self:class A * [line 16]\n n$23=*n$22._name:class A * [line 16]\n n$24=_fun___objc_release(n$23:class A *) [line 16]\n REMOVE_TEMPS(n$22,n$23,n$24); [line 16]\n " shape="box"] 23 -> 22 ; -22 [label="22: BinaryOperatorStmt: Assign \n n$21=*&self:class A * [line 16]\n n$22=*&name:class A * [line 16]\n *n$21._name:class A *=n$22 [line 16]\n REMOVE_TEMPS(n$21,n$22); [line 16]\n NULLIFY(&name,false); [line 16]\n NULLIFY(&self,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] +22 [label="22: BinaryOperatorStmt: Assign \n n$20=*&self:class A * [line 16]\n n$21=*&name:class A * [line 16]\n *n$20._name:class A *=n$21 [line 16]\n REMOVE_TEMPS(n$20,n$21); [line 16]\n NULLIFY(&name,false); [line 16]\n NULLIFY(&self,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] 22 -> 21 ; @@ -63,7 +63,7 @@ digraph iCFG { 20 -> 24 ; -19 [label="19: Return Stmt \n n$19=*&self:class A * [line 16]\n n$20=*n$19._name:class A * [line 16]\n *&return:class A *=n$20 [line 16]\n REMOVE_TEMPS(n$19,n$20); [line 16]\n NULLIFY(&self,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] +19 [label="19: Return Stmt \n n$18=*&self:class A * [line 16]\n n$19=*n$18._name:class A * [line 16]\n *&return:class A *=n$19 [line 16]\n REMOVE_TEMPS(n$18,n$19); [line 16]\n NULLIFY(&self,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] 19 -> 18 ; @@ -74,7 +74,7 @@ digraph iCFG { 17 -> 19 ; -16 [label="16: BinaryOperatorStmt: Assign \n n$16=*&self:class A * [line 14]\n n$18=*&child:class A * [line 14]\n n$17=_fun_A_copy(n$18:class A *) virtual [line 14]\n *n$16._child:class A *=n$17 [line 14]\n REMOVE_TEMPS(n$16,n$17,n$18); [line 14]\n NULLIFY(&child,false); [line 14]\n NULLIFY(&self,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] +16 [label="16: BinaryOperatorStmt: Assign \n n$15=*&self:class A * [line 14]\n n$16=*&child:class A * [line 14]\n n$17=_fun_A_copy(n$16:class A *) virtual [line 14]\n *n$15._child:class A *=n$17 [line 14]\n REMOVE_TEMPS(n$15,n$16,n$17); [line 14]\n NULLIFY(&child,false); [line 14]\n NULLIFY(&self,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] 16 -> 15 ; @@ -85,7 +85,7 @@ digraph iCFG { 14 -> 16 ; -13 [label="13: Return Stmt \n n$14=*&self:class A * [line 14]\n n$15=*n$14._child:class A * [line 14]\n *&return:class A *=n$15 [line 14]\n REMOVE_TEMPS(n$14,n$15); [line 14]\n NULLIFY(&self,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] +13 [label="13: Return Stmt \n n$13=*&self:class A * [line 14]\n n$14=*n$13._child:class A * [line 14]\n *&return:class A *=n$14 [line 14]\n REMOVE_TEMPS(n$13,n$14); [line 14]\n NULLIFY(&self,false); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] 13 -> 12 ; @@ -96,7 +96,7 @@ digraph iCFG { 11 -> 13 ; -10 [label="10: DeclStmt \n n$13=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 27]\n n$11=_fun_NSObject_init(n$13:class A *) virtual [line 27]\n *&other:class A *=n$11 [line 27]\n REMOVE_TEMPS(n$11,n$13); [line 27]\n " shape="box"] +10 [label="10: DeclStmt \n n$11=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 27]\n n$12=_fun_NSObject_init(n$11:class A *) virtual [line 27]\n *&other:class A *=n$12 [line 27]\n REMOVE_TEMPS(n$11,n$12); [line 27]\n " shape="box"] 10 -> 5 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot index e87a34a1b..7a41d0926 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot @@ -21,7 +21,7 @@ digraph iCFG { 7 -> 9 ; -6 [label="6: Return Stmt \n n$1=*&target:class A * [line 19]\n n$0=_fun_A_x(n$1:class A *) virtual [line 19]\n *&return:int =n$0 [line 19]\n REMOVE_TEMPS(n$0,n$1); [line 19]\n NULLIFY(&target,false); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] +6 [label="6: Return Stmt \n n$0=*&target:class A * [line 19]\n n$3=_fun_A_x(n$0:class A *) virtual [line 19]\n *&return:int =n$3 [line 19]\n REMOVE_TEMPS(n$0,n$3); [line 19]\n NULLIFY(&target,false); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] 6 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/property/aclass.dot b/infer/tests/codetoanalyze/objc/frontend/property/aclass.dot index 0546095d9..839ba99e0 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/aclass.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/aclass.dot @@ -1,9 +1,9 @@ digraph iCFG { -8 [label="8: Message Call: retain \n n$8=*&aDynValue:class NSObject * [line 13]\n n$7=_fun___objc_retain(n$8:class NSObject *) [line 13]\n REMOVE_TEMPS(n$7,n$8); [line 13]\n " shape="box"] +8 [label="8: Message Call: retain \n n$7=*&aDynValue:class NSObject * [line 13]\n n$8=_fun___objc_retain(n$7:class NSObject *) [line 13]\n REMOVE_TEMPS(n$7,n$8); [line 13]\n " shape="box"] 8 -> 7 ; -7 [label="7: Message Call: release \n n$5=*&self:class AClass * [line 13]\n n$6=*n$5._aDynValue:class NSObject * [line 13]\n n$4=_fun___objc_release(n$6:class NSObject *) [line 13]\n REMOVE_TEMPS(n$4,n$5,n$6); [line 13]\n " shape="box"] +7 [label="7: Message Call: release \n n$4=*&self:class AClass * [line 13]\n n$5=*n$4._aDynValue:class NSObject * [line 13]\n n$6=_fun___objc_release(n$5:class NSObject *) [line 13]\n REMOVE_TEMPS(n$4,n$5,n$6); [line 13]\n " shape="box"] 7 -> 6 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/property/main_car.dot b/infer/tests/codetoanalyze/objc/frontend/property/main_car.dot index 39b046b59..79b4230fc 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/main_car.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/main_car.dot @@ -1,5 +1,5 @@ digraph iCFG { -6 [label="6: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class Car ):unsigned long ) [line 13]\n n$4=_fun_NSObject_init(n$6:class Car *) virtual [line 13]\n *&honda:class Car *=n$4 [line 13]\n REMOVE_TEMPS(n$4,n$6); [line 13]\n " shape="box"] +6 [label="6: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class Car ):unsigned long ) [line 13]\n n$5=_fun_NSObject_init(n$4:class Car *) virtual [line 13]\n *&honda:class Car *=n$5 [line 13]\n REMOVE_TEMPS(n$4,n$5); [line 13]\n " shape="box"] 6 -> 5 ; @@ -7,7 +7,7 @@ digraph iCFG { 5 -> 4 ; -4 [label="4: Call _fun_NSLog \n n$0=_fun_NSString_stringWithUTF8String:(\"%d\":char *) [line 15]\n n$2=*&honda:class Car * [line 15]\n n$1=_fun_Car_running(n$2:class Car *) virtual [line 15]\n _fun_NSLog(n$0:struct objc_object *,n$1:int ) [line 15]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 15]\n NULLIFY(&honda,false); [line 15]\n " shape="box"] +4 [label="4: Call _fun_NSLog \n n$0=_fun_NSString_stringWithUTF8String:(\"%d\":char *) [line 15]\n n$1=*&honda:class Car * [line 15]\n n$2=_fun_Car_running(n$1:class Car *) virtual [line 15]\n _fun_NSLog(n$0:struct objc_object *,n$2:int ) [line 15]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 15]\n NULLIFY(&honda,false); [line 15]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.dot b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.dot index 9f7898e12..c5038b7e9 100644 --- a/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.dot +++ b/infer/tests/codetoanalyze/objc/frontend/protocol/protocol.dot @@ -3,15 +3,15 @@ digraph iCFG { 7 -> 2 ; -6 [label="6: Prune (false branch) \n PRUNE((n$0 == 0), false); [line 26]\n REMOVE_TEMPS(n$0,n$1); [line 26]\n " shape="invhouse"] +6 [label="6: Prune (false branch) \n PRUNE((n$1 == 0), false); [line 26]\n REMOVE_TEMPS(n$0,n$1); [line 26]\n " shape="invhouse"] 6 -> 3 ; -5 [label="5: Prune (true branch) \n PRUNE((n$0 != 0), true); [line 26]\n REMOVE_TEMPS(n$0,n$1); [line 26]\n " shape="invhouse"] +5 [label="5: Prune (true branch) \n PRUNE((n$1 != 0), true); [line 26]\n REMOVE_TEMPS(n$0,n$1); [line 26]\n " shape="invhouse"] 5 -> 7 ; -4 [label="4: Message Call: conformsToProtocol: \n n$1=*&self:class Bla * [line 26]\n n$0=_fun_Bla_conformsToProtocol:(n$1:class Bla *,\"Foo\":class Protocol *) virtual [line 26]\n NULLIFY(&self,false); [line 26]\n " shape="box"] +4 [label="4: Message Call: conformsToProtocol: \n n$0=*&self:class Bla * [line 26]\n n$1=_fun_Bla_conformsToProtocol:(n$0:class Bla *,\"Foo\":class Protocol *) virtual [line 26]\n NULLIFY(&self,false); [line 26]\n " shape="box"] 4 -> 5 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot b/infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot index f7b555712..caad30080 100644 --- a/infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot +++ b/infer/tests/codetoanalyze/objc/frontend/self_static/Self.dot @@ -7,15 +7,15 @@ digraph iCFG { 50 -> 45 ; -49 [label="49: Prune (false branch) \n PRUNE(((sizeof(class A ) != n$23) == 0), false); [line 98]\n REMOVE_TEMPS(n$23); [line 98]\n " shape="invhouse"] +49 [label="49: Prune (false branch) \n PRUNE(((sizeof(class A ) != n$15) == 0), false); [line 98]\n REMOVE_TEMPS(n$15); [line 98]\n " shape="invhouse"] 49 -> 51 ; -48 [label="48: Prune (true branch) \n PRUNE(((sizeof(class A ) != n$23) != 0), true); [line 98]\n REMOVE_TEMPS(n$23); [line 98]\n " shape="invhouse"] +48 [label="48: Prune (true branch) \n PRUNE(((sizeof(class A ) != n$15) != 0), true); [line 98]\n REMOVE_TEMPS(n$15); [line 98]\n " shape="invhouse"] 48 -> 50 ; -47 [label="47: BinaryOperatorStmt: NE \n n$23=*&c:struct objc_class * [line 98]\n NULLIFY(&c,false); [line 98]\n " shape="box"] +47 [label="47: BinaryOperatorStmt: NE \n n$15=*&c:struct objc_class * [line 98]\n NULLIFY(&c,false); [line 98]\n " shape="box"] 47 -> 48 ; @@ -31,7 +31,7 @@ digraph iCFG { 44 -> 47 ; -43 [label="43: Return Stmt \n n$22=_fun_NSStringFromClass(sizeof(class A ):unsigned long ) [line 93]\n *&return:class NSString *=n$22 [line 93]\n REMOVE_TEMPS(n$22); [line 93]\n APPLY_ABSTRACTION; [line 93]\n " shape="box"] +43 [label="43: Return Stmt \n n$14=_fun_NSStringFromClass(sizeof(class A ):unsigned long ) [line 93]\n *&return:class NSString *=n$14 [line 93]\n REMOVE_TEMPS(n$14); [line 93]\n APPLY_ABSTRACTION; [line 93]\n " shape="box"] 43 -> 42 ; @@ -42,7 +42,7 @@ digraph iCFG { 41 -> 43 ; -40 [label="40: Message Call: init \n n$19=*&self:class A * [line 88]\n n$18=_fun_NSObject_init(n$19:class A *) [line 88]\n REMOVE_TEMPS(n$18,n$19); [line 88]\n NULLIFY(&self,false); [line 88]\n APPLY_ABSTRACTION; [line 88]\n " shape="box"] +40 [label="40: Message Call: init \n n$11=*&self:class A * [line 88]\n n$12=_fun_NSObject_init(n$11:class A *) [line 88]\n REMOVE_TEMPS(n$11,n$12); [line 88]\n NULLIFY(&self,false); [line 88]\n APPLY_ABSTRACTION; [line 88]\n " shape="box"] 40 -> 39 ; @@ -64,7 +64,7 @@ digraph iCFG { 35 -> 37 ; -34 [label="34: Return Stmt \n n$15=*&object:class B * [line 80]\n n$14=_fun_B_isC:(n$15:class B *,sizeof(class A ):unsigned long ) virtual [line 80]\n *&return:_Bool =n$14 [line 80]\n REMOVE_TEMPS(n$14,n$15); [line 80]\n NULLIFY(&object,false); [line 80]\n APPLY_ABSTRACTION; [line 80]\n " shape="box"] +34 [label="34: Return Stmt \n n$8=*&object:class B * [line 80]\n n$10=_fun_B_isC:(n$8:class B *,sizeof(class A ):unsigned long ) virtual [line 80]\n *&return:_Bool =n$10 [line 80]\n REMOVE_TEMPS(n$8,n$10); [line 80]\n NULLIFY(&object,false); [line 80]\n APPLY_ABSTRACTION; [line 80]\n " shape="box"] 34 -> 33 ; @@ -75,7 +75,7 @@ digraph iCFG { 32 -> 34 ; -31 [label="31: DeclStmt \n n$12=_fun___objc_alloc_no_fail(sizeof(class B ):unsigned long ) [line 75]\n n$13=_fun_NSObject_init(n$12:class B *) virtual [line 75]\n *&b:class B *=n$13 [line 75]\n REMOVE_TEMPS(n$12,n$13); [line 75]\n NULLIFY(&b,false); [line 75]\n " shape="box"] +31 [label="31: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class B ):unsigned long ) [line 75]\n n$7=_fun_NSObject_init(n$6:class B *) virtual [line 75]\n *&b:class B *=n$7 [line 75]\n REMOVE_TEMPS(n$6,n$7); [line 75]\n NULLIFY(&b,false); [line 75]\n " shape="box"] 31 -> 30 ; @@ -112,7 +112,7 @@ digraph iCFG { 22 -> 24 ; -21 [label="21: Call alloc \n n$6=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 63]\n REMOVE_TEMPS(n$6); [line 63]\n APPLY_ABSTRACTION; [line 63]\n " shape="box"] +21 [label="21: Call alloc \n n$3=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 63]\n REMOVE_TEMPS(n$3); [line 63]\n APPLY_ABSTRACTION; [line 63]\n " shape="box"] 21 -> 20 ; @@ -123,7 +123,7 @@ digraph iCFG { 19 -> 21 ; -18 [label="18: Call alloc \n n$2=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 59]\n REMOVE_TEMPS(n$2); [line 59]\n APPLY_ABSTRACTION; [line 59]\n " shape="box"] +18 [label="18: Call alloc \n n$1=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 59]\n REMOVE_TEMPS(n$1); [line 59]\n APPLY_ABSTRACTION; [line 59]\n " shape="box"] 18 -> 17 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/self_static/static.dot b/infer/tests/codetoanalyze/objc/frontend/self_static/static.dot index dcac7738b..67a980e58 100644 --- a/infer/tests/codetoanalyze/objc/frontend/self_static/static.dot +++ b/infer/tests/codetoanalyze/objc/frontend/self_static/static.dot @@ -1,5 +1,5 @@ digraph iCFG { -15 [label="15: Message Call: getX \n n$3=*&self:class MyClass * [line 37]\n n$2=_fun_MyClass_getX(n$3:class MyClass *) virtual [line 37]\n REMOVE_TEMPS(n$2,n$3); [line 37]\n NULLIFY(&self,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +15 [label="15: Message Call: getX \n n$1=*&self:class MyClass * [line 37]\n n$2=_fun_MyClass_getX(n$1:class MyClass *) virtual [line 37]\n REMOVE_TEMPS(n$1,n$2); [line 37]\n NULLIFY(&self,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] 15 -> 14 ; @@ -43,7 +43,7 @@ digraph iCFG { 4 -> 6 ; -3 [label="3: DeclStmt \n n$1=_fun___objc_alloc_no_fail(sizeof(class MyClass ):unsigned long ) [line 21]\n *&myClass:class MyClass *=n$1 [line 21]\n REMOVE_TEMPS(n$1); [line 21]\n NULLIFY(&myClass,false); [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] +3 [label="3: DeclStmt \n n$0=_fun___objc_alloc_no_fail(sizeof(class MyClass ):unsigned long ) [line 21]\n *&myClass:class MyClass *=n$0 [line 21]\n REMOVE_TEMPS(n$0); [line 21]\n NULLIFY(&myClass,false); [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] 3 -> 2 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.dot index 5f7867885..bf63f93ca 100644 --- a/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.dot +++ b/infer/tests/codetoanalyze/objc/frontend/subclass/MySubClass.dot @@ -1,5 +1,5 @@ digraph iCFG { -4 [label="4: DeclStmt \n n$2=*&self:class MySubclass * [line 17]\n n$1=_fun_MyClass_myNumber(n$2:class MySubclass *) [line 17]\n *&subclassNumber:int =(n$1 + 1) [line 17]\n REMOVE_TEMPS(n$1,n$2); [line 17]\n NULLIFY(&self,false); [line 17]\n " shape="box"] +4 [label="4: DeclStmt \n n$1=*&self:class MySubclass * [line 17]\n n$2=_fun_MyClass_myNumber(n$1:class MySubclass *) [line 17]\n *&subclassNumber:int =(n$2 + 1) [line 17]\n REMOVE_TEMPS(n$1,n$2); [line 17]\n NULLIFY(&self,false); [line 17]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/subclass/main.dot b/infer/tests/codetoanalyze/objc/frontend/subclass/main.dot index fdd1dd286..fa5e55385 100644 --- a/infer/tests/codetoanalyze/objc/frontend/subclass/main.dot +++ b/infer/tests/codetoanalyze/objc/frontend/subclass/main.dot @@ -1,5 +1,5 @@ digraph iCFG { -4 [label="4: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 13]\n n$0=_fun_NSObject_init(n$2:class A *) virtual [line 13]\n *&a:class A *=n$0 [line 13]\n REMOVE_TEMPS(n$0,n$2); [line 13]\n NULLIFY(&a,false); [line 13]\n " shape="box"] +4 [label="4: DeclStmt \n n$0=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 13]\n n$1=_fun_NSObject_init(n$0:class A *) virtual [line 13]\n *&a:class A *=n$1 [line 13]\n REMOVE_TEMPS(n$0,n$1); [line 13]\n NULLIFY(&a,false); [line 13]\n " shape="box"] 4 -> 3 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/types/attributes.dot b/infer/tests/codetoanalyze/objc/frontend/types/attributes.dot index 7fc954a9a..53beff468 100644 --- a/infer/tests/codetoanalyze/objc/frontend/types/attributes.dot +++ b/infer/tests/codetoanalyze/objc/frontend/types/attributes.dot @@ -19,7 +19,7 @@ digraph iCFG { 10 -> 9 ; -9 [label="9: BinaryOperatorStmt: Assign \n n$10=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 29]\n *&aStrongRef:class A *=n$10 [line 29]\n REMOVE_TEMPS(n$10); [line 29]\n " shape="box"] +9 [label="9: BinaryOperatorStmt: Assign \n n$9=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 29]\n *&aStrongRef:class A *=n$9 [line 29]\n REMOVE_TEMPS(n$9); [line 29]\n " shape="box"] 9 -> 8 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/types/void_call.dot b/infer/tests/codetoanalyze/objc/frontend/types/void_call.dot index f3e33ac02..2ff96e7d6 100644 --- a/infer/tests/codetoanalyze/objc/frontend/types/void_call.dot +++ b/infer/tests/codetoanalyze/objc/frontend/types/void_call.dot @@ -3,15 +3,15 @@ digraph iCFG { 24 -> 23 ; -23 [label="23: Call _fun_foo1 \n n$10=*&x:int [line 44]\n _fun_foo1(n$10:int ) [line 44]\n REMOVE_TEMPS(n$10); [line 44]\n " shape="box"] +23 [label="23: Call _fun_foo1 \n n$9=*&x:int [line 44]\n _fun_foo1(n$9:int ) [line 44]\n REMOVE_TEMPS(n$9); [line 44]\n " shape="box"] 23 -> 22 ; -22 [label="22: BinaryOperatorStmt: Assign \n n$8=*&x:int [line 46]\n n$9=_fun_bar1(n$8:int ) [line 46]\n *&x:int =n$9 [line 46]\n REMOVE_TEMPS(n$8,n$9); [line 46]\n " shape="box"] +22 [label="22: BinaryOperatorStmt: Assign \n n$7=*&x:int [line 46]\n n$8=_fun_bar1(n$7:int ) [line 46]\n *&x:int =n$8 [line 46]\n REMOVE_TEMPS(n$7,n$8); [line 46]\n " shape="box"] 22 -> 21 ; -21 [label="21: DeclStmt \n n$7=_fun___objc_alloc_no_fail(sizeof(class AClass ):unsigned long ) [line 48]\n *&o:class AClass *=n$7 [line 48]\n REMOVE_TEMPS(n$7); [line 48]\n " shape="box"] +21 [label="21: DeclStmt \n n$6=_fun___objc_alloc_no_fail(sizeof(class AClass ):unsigned long ) [line 48]\n *&o:class AClass *=n$6 [line 48]\n REMOVE_TEMPS(n$6); [line 48]\n " shape="box"] 21 -> 17 ; @@ -20,7 +20,7 @@ digraph iCFG { 20 -> 19 ; -19 [label="19: BinaryOperatorStmt: Assign \n n$2=*&o:class AClass * [line 53]\n n$3=*&x:int [line 53]\n n$1=_fun_AClass_bar:(n$2:class AClass *,n$3:int ) virtual [line 53]\n *&x:int =n$1 [line 53]\n REMOVE_TEMPS(n$1,n$2,n$3); [line 53]\n NULLIFY(&o,false); [line 53]\n NULLIFY(&x,false); [line 53]\n APPLY_ABSTRACTION; [line 53]\n " shape="box"] +19 [label="19: BinaryOperatorStmt: Assign \n n$1=*&o:class AClass * [line 53]\n n$2=*&x:int [line 53]\n n$3=_fun_AClass_bar:(n$1:class AClass *,n$2:int ) virtual [line 53]\n *&x:int =n$3 [line 53]\n REMOVE_TEMPS(n$1,n$2,n$3); [line 53]\n NULLIFY(&o,false); [line 53]\n NULLIFY(&x,false); [line 53]\n APPLY_ABSTRACTION; [line 53]\n " shape="box"] 19 -> 16 ; diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot index 278948d1f..d82410fa3 100644 --- a/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot +++ b/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.dot @@ -1,13 +1,13 @@ digraph iCFG { -8 [label="8: DeclStmt \n n$7=_fun___objc_alloc_no_fail(sizeof(class C ):unsigned long ) [line 22]\n *&c1:class C *=n$7 [line 22]\n REMOVE_TEMPS(n$7); [line 22]\n " shape="box"] +8 [label="8: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class C ):unsigned long ) [line 22]\n *&c1:class C *=n$5 [line 22]\n REMOVE_TEMPS(n$5); [line 22]\n " shape="box"] 8 -> 7 ; -7 [label="7: DeclStmt \n n$5=_fun___objc_alloc_no_fail(sizeof(class C ):unsigned long ) [line 23]\n *&c2:class C *=n$5 [line 23]\n REMOVE_TEMPS(n$5); [line 23]\n " shape="box"] +7 [label="7: DeclStmt \n n$4=_fun___objc_alloc_no_fail(sizeof(class C ):unsigned long ) [line 23]\n *&c2:class C *=n$4 [line 23]\n REMOVE_TEMPS(n$4); [line 23]\n " shape="box"] 7 -> 6 ; -6 [label="6: InitListExp \n n$1=*&c1:class C * [line 24]\n n$0=_fun_NSObject_init(n$1:class C *) virtual [line 24]\n n$2=*&c1:class C * [line 24]\n n$3=*&c2:class C * [line 24]\n *&a[0]:class C *=n$0 [line 24]\n _fun___objc_retain(n$2:class C *) [line 24]\n *&a[1]:class C *=n$2 [line 24]\n _fun___objc_retain(n$3:class C *) [line 24]\n *&a[2]:class C *=n$3 [line 24]\n REMOVE_TEMPS(n$0,n$1,n$2,n$3); [line 24]\n NULLIFY(&c1,false); [line 24]\n NULLIFY(&c2,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +6 [label="6: InitListExp \n n$0=*&c1:class C * [line 24]\n n$1=_fun_NSObject_init(n$0:class C *) virtual [line 24]\n n$2=*&c1:class C * [line 24]\n n$3=*&c2:class C * [line 24]\n *&a[0]:class C *=n$1 [line 24]\n _fun___objc_retain(n$2:class C *) [line 24]\n *&a[1]:class C *=n$2 [line 24]\n _fun___objc_retain(n$3:class C *) [line 24]\n *&a[2]:class C *=n$3 [line 24]\n REMOVE_TEMPS(n$0,n$1,n$2,n$3); [line 24]\n NULLIFY(&c1,false); [line 24]\n NULLIFY(&c2,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] 6 -> 5 ;