[clang frontend][objc] Fix types of variables captured by reference in objc blocks

Summary: Variables captured by reference do not have correct type in objc blocks. They are missing one reference. This diff sets the correct type of captured reference variables inside procdesc, similarly as we already have for cpp lambdas. The translation of block's body will then take into account the type of captured variable from procdesc.

Reviewed By: ezgicicek

Differential Revision: D26945575

fbshipit-source-id: 06a9d9cc6
master
Daiva Naudziuniene 4 years ago committed by Facebook GitHub Bot
parent 0599185fca
commit 778c629401

@ -299,7 +299,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
let assign_captured_var loc (cvar, typ, mode) =
match mode with
| Pvar.ByReference ->
((Exp.Lvar cvar, cvar, Typ.mk_ptr ~ptr_kind:Pk_reference typ, mode), None)
((Exp.Lvar cvar, cvar, typ, mode), None)
| Pvar.ByValue ->
let id = Ident.create_fresh Ident.knormal in
let instr = Sil.Load {id; e= Exp.Lvar cvar; root_typ= typ; typ; loc} in
@ -829,16 +829,24 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
CContext.add_block_static_var context procname (pvar, typ) ;
let var_exp = Exp.Lvar pvar in
(* Captured variables without initialization do not have the correct types
inside of lambda bodies. Use the types stored in the procdesc. *)
let typ =
inside of lambda bodies. The same issue happens for variables captured by reference
inside objc blocks. Use the types stored in the procdesc. *)
let is_objc_block_or_cpp_lambda =
match procname with
| Procname.ObjC_Cpp cpp_pname when Procname.ObjC_Cpp.is_cpp_lambda cpp_pname ->
let pvar_name = Pvar.get_name pvar in
List.find (Procdesc.get_captured context.procdesc)
~f:(fun {CapturedVar.name= captured_var} -> Mangled.equal captured_var pvar_name)
|> Option.value_map ~f:(fun {CapturedVar.typ} -> typ) ~default:typ
true
| Block _ ->
true
| _ ->
typ
false
in
let typ =
if is_objc_block_or_cpp_lambda then
let pvar_name = Pvar.get_name pvar in
List.find (Procdesc.get_captured context.procdesc)
~f:(fun {CapturedVar.name= captured_var} -> Mangled.equal captured_var pvar_name)
|> Option.value_map ~f:(fun {CapturedVar.typ} -> typ) ~default:typ
else typ
in
let return =
if Self.is_var_self pvar (CContext.is_objc_method context) && CType.is_class typ then
@ -3357,8 +3365,10 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s
let passed_as_noescape_block_to = trans_state.passed_as_noescape_block_to in
let captured_vars =
List.map captured_vars_no_mode ~f:(fun (var, typ, modify_in_block) ->
let mode =
if modify_in_block || Pvar.is_global var then Pvar.ByReference else Pvar.ByValue
let mode, typ =
if modify_in_block || Pvar.is_global var then
(Pvar.ByReference, Typ.mk (Tptr (typ, Pk_reference)))
else (Pvar.ByValue, typ)
in
(var, typ, mode) )
in

@ -11,14 +11,14 @@ digraph cfg {
"objc_blockEscapingByref.capture_global_byref_1.71c6ece6ee30cbceb6bb1ac4222fc774_3" -> "objc_blockEscapingByref.capture_global_byref_1.71c6ece6ee30cbceb6bb1ac4222fc774_2" ;
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_1" [label="1: Start objc_blockEscapingByref.capture_local_block_byref_3\nFormals: local:int\nLocals: \nCaptured: [by ref]local:int \n " color=yellow style=filled]
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_1" [label="1: Start objc_blockEscapingByref.capture_local_block_byref_3\nFormals: local:int&\nLocals: \nCaptured: [by ref]local:int& \n " color=yellow style=filled]
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_1" -> "objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_3" ;
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_2" [label="2: Exit objc_blockEscapingByref.capture_local_block_byref_3 \n " color=yellow style=filled]
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_3" [label="3: BinaryOperatorStmt: Assign \n *&local:int=3 [line 33, column 5]\n " shape="box"]
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_3" [label="3: BinaryOperatorStmt: Assign \n n$2=*&local:int& [line 33, column 5]\n *n$2:int=3 [line 33, column 5]\n " shape="box"]
"objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_3" -> "objc_blockEscapingByref.capture_local_block_byref_3.e3584f1ccd5f005a0c753b9bf434cd37_2" ;
@ -40,7 +40,7 @@ digraph cfg {
"objc_blockEscapingByref.capture_local_static_byvalue_4.c3f6724a818e1f8b6ce2010807ddaa98_2" [label="2: Exit objc_blockEscapingByref.capture_local_static_byvalue_4 \n " color=yellow style=filled]
"objc_blockEscapingByref.capture_local_static_byvalue_4.c3f6724a818e1f8b6ce2010807ddaa98_3" [label="3: DeclStmt \n VARIABLE_DECLARED(x:int); [line 40, column 5]\n n$2=*&#GB<codetoanalyze/objc/frontend/block/escaping_byref.m>$EscapingByref.capture_local_static_byvalue.local:int [line 40, column 13]\n *&x:int=n$2 [line 40, column 5]\n " shape="box"]
"objc_blockEscapingByref.capture_local_static_byvalue_4.c3f6724a818e1f8b6ce2010807ddaa98_3" [label="3: DeclStmt \n VARIABLE_DECLARED(x:int); [line 40, column 5]\n n$3=*&#GB<codetoanalyze/objc/frontend/block/escaping_byref.m>$EscapingByref.capture_local_static_byvalue.local:int [line 40, column 13]\n *&x:int=n$3 [line 40, column 5]\n " shape="box"]
"objc_blockEscapingByref.capture_local_static_byvalue_4.c3f6724a818e1f8b6ce2010807ddaa98_3" -> "objc_blockEscapingByref.capture_local_static_byvalue_4.c3f6724a818e1f8b6ce2010807ddaa98_2" ;
@ -51,7 +51,7 @@ digraph cfg {
"objc_blockEscapingByref.capture_param_byvalue:_5.f5bb82a8a518c0c4d631c0f262866fb5_2" [label="2: Exit objc_blockEscapingByref.capture_param_byvalue:_5 \n " color=yellow style=filled]
"objc_blockEscapingByref.capture_param_byvalue:_5.f5bb82a8a518c0c4d631c0f262866fb5_3" [label="3: DeclStmt \n VARIABLE_DECLARED(x:int); [line 46, column 5]\n n$4=*&param:int [line 46, column 13]\n *&x:int=n$4 [line 46, column 5]\n " shape="box"]
"objc_blockEscapingByref.capture_param_byvalue:_5.f5bb82a8a518c0c4d631c0f262866fb5_3" [label="3: DeclStmt \n VARIABLE_DECLARED(x:int); [line 46, column 5]\n n$5=*&param:int [line 46, column 13]\n *&x:int=n$5 [line 46, column 5]\n " shape="box"]
"objc_blockEscapingByref.capture_param_byvalue:_5.f5bb82a8a518c0c4d631c0f262866fb5_3" -> "objc_blockEscapingByref.capture_param_byvalue:_5.f5bb82a8a518c0c4d631c0f262866fb5_2" ;
@ -110,7 +110,7 @@ digraph cfg {
"capture_param_byvalue:#EscapingByref#class.53132577f6f77d4aff66fe10ebd3eee9_2" [label="2: Exit EscapingByref.capture_param_byvalue: \n " color=yellow style=filled]
"capture_param_byvalue:#EscapingByref#class.53132577f6f77d4aff66fe10ebd3eee9_3" [label="3: DeclStmt \n VARIABLE_DECLARED(closure:_fn_(*)); [line 45, column 3]\n n$3=*&param:int [line 45, column 23]\n *&closure:_fn_(*)=(_fun_objc_blockEscapingByref.capture_param_byvalue:_5,([by value]n$3 &param:int)) [line 45, column 3]\n " shape="box"]
"capture_param_byvalue:#EscapingByref#class.53132577f6f77d4aff66fe10ebd3eee9_3" [label="3: DeclStmt \n VARIABLE_DECLARED(closure:_fn_(*)); [line 45, column 3]\n n$4=*&param:int [line 45, column 23]\n *&closure:_fn_(*)=(_fun_objc_blockEscapingByref.capture_param_byvalue:_5,([by value]n$4 &param:int)) [line 45, column 3]\n " shape="box"]
"capture_param_byvalue:#EscapingByref#class.53132577f6f77d4aff66fe10ebd3eee9_3" -> "capture_param_byvalue:#EscapingByref#class.53132577f6f77d4aff66fe10ebd3eee9_2" ;

@ -49,7 +49,7 @@ int captured_npe_bad() {
return my_block();
}
int captured_npe_ok_FP(int* y) {
int captured_npe_ok(int* y) {
__block int* x = NULL;
void (^my_block)(void) = ^() {
x = y;

@ -9,7 +9,6 @@ codetoanalyze/objc/pulse/MemoryLeaks.m, call_cfrelease_interproc_leak_ok_FP, 2,
codetoanalyze/objc/pulse/MemoryLeaksInBlocks.m, block_captured_var_leak_bad, 6, MEMORY_LEAK, no_bucket, ERROR, [allocation part of the trace starts here,allocated by call to `malloc_no_fail` (modelled),allocation part of the trace ends here,memory becomes unreachable here]
codetoanalyze/objc/pulse/NPEBlocks.m, Singleton.dispatch_once_no_npe_good_FP, 6, NULLPTR_DEREFERENCE, no_bucket, ERROR, [source of the null value part of the trace starts here,assigned,is the null pointer,null pointer dereference part of the trace starts here,assigned,invalid access occurs here]
codetoanalyze/objc/pulse/NPEBlocks.m, captured_npe_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [source of the null value part of the trace starts here,assigned,is the null pointer,null pointer dereference part of the trace starts here,assigned,when calling `objc_blockcaptured_npe_bad_3` here,parameter `x` of objc_blockcaptured_npe_bad_3,invalid access occurs here]
codetoanalyze/objc/pulse/NPEBlocks.m, captured_npe_ok_FP, 6, NULLPTR_DEREFERENCE, no_bucket, ERROR, [source of the null value part of the trace starts here,assigned,is the null pointer,null pointer dereference part of the trace starts here,assigned,invalid access occurs here]
codetoanalyze/objc/pulse/uninit.m, Uninit.capture_in_closure_bad, 7, PULSE_UNINITIALIZED_VALUE, no_bucket, ERROR, [variable `x` declared here,read to uninitialized value occurs here]
codetoanalyze/objc/pulse/uninit.m, Uninit.not_set_in_closure_bad, 7, PULSE_UNINITIALIZED_VALUE, no_bucket, ERROR, [variable `x` declared here,read to uninitialized value occurs here]
codetoanalyze/objc/pulse/use_after_free.m, PulseTest.use_after_free_simple_in_objc_method_bad:, 2, USE_AFTER_FREE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of PulseTest.use_after_free_simple_in_objc_method_bad:,was invalidated by call to `free()`,use-after-lifetime part of the trace starts here,parameter `x` of PulseTest.use_after_free_simple_in_objc_method_bad:,invalid access occurs here]

@ -48,14 +48,14 @@ digraph cfg {
"DispatchMain.f6461dbdaeaf9a114cbe40f5f72fbb3f_12" -> "DispatchMain.f6461dbdaeaf9a114cbe40f5f72fbb3f_11" ;
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_1" [label="1: Start objc_blockDispatchA.block_attribute_2\nFormals: a:DispatchA*\nLocals: \nCaptured: [by ref]a:DispatchA* \n " color=yellow style=filled]
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_1" [label="1: Start objc_blockDispatchA.block_attribute_2\nFormals: a:DispatchA*&\nLocals: \nCaptured: [by ref]a:DispatchA*& \n " color=yellow style=filled]
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_1" -> "objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_3" ;
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_2" [label="2: Exit objc_blockDispatchA.block_attribute_2 \n " color=yellow style=filled]
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_3" [label="3: BinaryOperatorStmt: Assign \n n$7=*&a:DispatchA* [line 38, column 5]\n *n$7._x:int=10 [line 38, column 5]\n " shape="box"]
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_3" [label="3: BinaryOperatorStmt: Assign \n n$7=*&a:DispatchA*& [line 38, column 5]\n n$8=*n$7:DispatchA* [line 38, column 5]\n *n$8._x:int=10 [line 38, column 5]\n " shape="box"]
"objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_3" -> "objc_blockDispatchA.block_attribute_2(class DispatchA).fbb5956dc6c8f95a8f2ae751ac2b44a1_2" ;
@ -66,7 +66,7 @@ digraph cfg {
"objc_blockDispatchA.dispatch_a_block_variable_4.85a73921543aa13f4bc6d889cc185a8d_2" [label="2: Exit objc_blockDispatchA.dispatch_a_block_variable_4 \n " color=yellow style=filled]
"objc_blockDispatchA.dispatch_a_block_variable_4.85a73921543aa13f4bc6d889cc185a8d_3" [label="3: BinaryOperatorStmt: Assign \n n$19=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 55, column 25]\n n$20=_fun_NSObject.init(n$19:DispatchA*) virtual [line 55, column 25]\n *&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable.static_storage__:DispatchA*=n$20 [line 55, column 5]\n " shape="box"]
"objc_blockDispatchA.dispatch_a_block_variable_4.85a73921543aa13f4bc6d889cc185a8d_3" [label="3: BinaryOperatorStmt: Assign \n n$20=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 55, column 25]\n n$21=_fun_NSObject.init(n$20:DispatchA*) virtual [line 55, column 25]\n *&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable.static_storage__:DispatchA*=n$21 [line 55, column 5]\n " shape="box"]
"objc_blockDispatchA.dispatch_a_block_variable_4.85a73921543aa13f4bc6d889cc185a8d_3" -> "objc_blockDispatchA.dispatch_a_block_variable_4.85a73921543aa13f4bc6d889cc185a8d_2" ;
@ -77,7 +77,7 @@ digraph cfg {
"objc_blockDispatchA.dispatch_a_block_variable_from_macro_5.8b47e325760aa028beb8a7010bc38e1c_2" [label="2: Exit objc_blockDispatchA.dispatch_a_block_variable_from_macro_5 \n " color=yellow style=filled]
"objc_blockDispatchA.dispatch_a_block_variable_from_macro_5.8b47e325760aa028beb8a7010bc38e1c_3" [label="3: BinaryOperatorStmt: Assign \n n$24=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 66, column 27]\n n$25=_fun_NSObject.init(n$24:DispatchA*) virtual [line 66, column 27]\n *&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable_from_macro.static_storage__:DispatchA*=n$25 [line 66, column 7]\n " shape="box"]
"objc_blockDispatchA.dispatch_a_block_variable_from_macro_5.8b47e325760aa028beb8a7010bc38e1c_3" [label="3: BinaryOperatorStmt: Assign \n n$25=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 66, column 27]\n n$26=_fun_NSObject.init(n$25:DispatchA*) virtual [line 66, column 27]\n *&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable_from_macro.static_storage__:DispatchA*=n$26 [line 66, column 7]\n " shape="box"]
"objc_blockDispatchA.dispatch_a_block_variable_from_macro_5.8b47e325760aa028beb8a7010bc38e1c_3" -> "objc_blockDispatchA.dispatch_a_block_variable_from_macro_5.8b47e325760aa028beb8a7010bc38e1c_2" ;
@ -99,7 +99,7 @@ digraph cfg {
"objc_blockDispatchA.trans_3.2993ae0bfb5e0ec6d91c5c53d1084592_2" [label="2: Exit objc_blockDispatchA.trans_3 \n " color=yellow style=filled]
"objc_blockDispatchA.trans_3.2993ae0bfb5e0ec6d91c5c53d1084592_3" [label="3: BinaryOperatorStmt: Assign \n n$14=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 46, column 23]\n n$15=_fun_DispatchA.init(n$14:DispatchA*) virtual [line 46, column 22]\n *&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.trans.sharedInstance:objc_object*=n$15 [line 46, column 5]\n " shape="box"]
"objc_blockDispatchA.trans_3.2993ae0bfb5e0ec6d91c5c53d1084592_3" [label="3: BinaryOperatorStmt: Assign \n n$15=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 46, column 23]\n n$16=_fun_DispatchA.init(n$15:DispatchA*) virtual [line 46, column 22]\n *&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.trans.sharedInstance:objc_object*=n$16 [line 46, column 5]\n " shape="box"]
"objc_blockDispatchA.trans_3.2993ae0bfb5e0ec6d91c5c53d1084592_3" -> "objc_blockDispatchA.trans_3.2993ae0bfb5e0ec6d91c5c53d1084592_2" ;
@ -118,11 +118,11 @@ digraph cfg {
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_4" -> "block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_2" ;
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_5" [label="5: Compound statement \n n$8=_fun__dispatch_once(&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.block_attribute.once:long*,(_fun_objc_blockDispatchA.block_attribute_2,&a):_fn_(*)) [line 37, column 3]\n " shape="box"]
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_5" [label="5: Compound statement \n n$9=_fun__dispatch_once(&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.block_attribute.once:long*,(_fun_objc_blockDispatchA.block_attribute_2,&a):_fn_(*)) [line 37, column 3]\n " shape="box"]
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_5" -> "block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_3" ;
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_6" [label="6: DeclStmt \n VARIABLE_DECLARED(a:DispatchA*); [line 36, column 3]\n n$9=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 36, column 26]\n n$10=_fun_NSObject.init(n$9:DispatchA*) virtual [line 36, column 26]\n *&a:DispatchA*=n$10 [line 36, column 3]\n " shape="box"]
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_6" [label="6: DeclStmt \n VARIABLE_DECLARED(a:DispatchA*); [line 36, column 3]\n n$10=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 36, column 26]\n n$11=_fun_NSObject.init(n$10:DispatchA*) virtual [line 36, column 26]\n *&a:DispatchA*=n$11 [line 36, column 3]\n " shape="box"]
"block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_6" -> "block_attribute#DispatchA#class.df997e345dbf19ec3438c667c942e14a_5" ;
@ -133,15 +133,15 @@ digraph cfg {
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_2" [label="2: Exit DispatchA.dispatch_a_block_variable \n " color=yellow style=filled]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" [label="3: Return Stmt \n n$16=*&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable.static_storage__:DispatchA* [line 59, column 10]\n " shape="box"]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" [label="3: Return Stmt \n n$17=*&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable.static_storage__:DispatchA* [line 59, column 10]\n " shape="box"]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" -> "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" ;
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" [label="4: Return Stmt \n *&return:objc_object*=n$16 [line 59, column 3]\n " shape="box"]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" [label="4: Return Stmt \n *&return:objc_object*=n$17 [line 59, column 3]\n " shape="box"]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" -> "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_2" ;
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_5" [label="5: Call _fun__dispatch_once \n n$17=*&initialization_block__:_fn_(*) [line 58, column 32]\n n$18=_fun__dispatch_once(&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable.once_token__:long*,(_fun_objc_blockDispatchA.dispatch_a_block_variable_4):_fn_(*)) [line 58, column 3]\n " shape="box"]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_5" [label="5: Call _fun__dispatch_once \n n$18=*&initialization_block__:_fn_(*) [line 58, column 32]\n n$19=_fun__dispatch_once(&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable.once_token__:long*,(_fun_objc_blockDispatchA.dispatch_a_block_variable_4):_fn_(*)) [line 58, column 3]\n " shape="box"]
"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_5" -> "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" ;
@ -156,11 +156,11 @@ digraph cfg {
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_2" [label="2: Exit DispatchA.dispatch_a_block_variable_from_macro \n " color=yellow style=filled]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_3" [label="3: Compound statement \n n$21=*&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable_from_macro.static_storage__:DispatchA* [line 70, column 5]\n " shape="box"]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_3" [label="3: Compound statement \n n$22=*&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable_from_macro.static_storage__:DispatchA* [line 70, column 5]\n " shape="box"]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_3" -> "dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_6" ;
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_4" [label="4: Call _fun__dispatch_once \n n$22=*&initialization_block__:_fn_(*) [line 69, column 34]\n n$23=_fun__dispatch_once(&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable_from_macro.once_token__:long*,(_fun_objc_blockDispatchA.dispatch_a_block_variable_from_macro_5):_fn_(*)) [line 69, column 5]\n " shape="box"]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_4" [label="4: Call _fun__dispatch_once \n n$23=*&initialization_block__:_fn_(*) [line 69, column 34]\n n$24=_fun__dispatch_once(&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.dispatch_a_block_variable_from_macro.once_token__:long*,(_fun_objc_blockDispatchA.dispatch_a_block_variable_from_macro_5):_fn_(*)) [line 69, column 5]\n " shape="box"]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_4" -> "dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_3" ;
@ -168,7 +168,7 @@ digraph cfg {
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_5" -> "dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_4" ;
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_6" [label="6: Return Stmt \n *&return:objc_object*=n$21 [line 63, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_6" [label="6: Return Stmt \n *&return:objc_object*=n$22 [line 63, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_6" -> "dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_2" ;
@ -179,19 +179,19 @@ digraph cfg {
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_2" [label="2: Exit DispatchA.dispatch_a_block_variable_from_macro_delivers_initialised_object \n " color=yellow style=filled]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_3" [label="3: Return Stmt \n n$26=*&a:DispatchA* [line 77, column 15]\n n$27=*n$26._x:int [line 77, column 15]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_3" [label="3: Return Stmt \n n$27=*&a:DispatchA* [line 77, column 15]\n n$28=*n$27._x:int [line 77, column 15]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_3" -> "dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_4" ;
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_4" [label="4: Return Stmt \n *&return:int=(1 / (n$27 - 5)) [line 77, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_4" [label="4: Return Stmt \n *&return:int=(1 / (n$28 - 5)) [line 77, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_4" -> "dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_2" ;
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_5" [label="5: BinaryOperatorStmt: Assign \n n$28=*&a:DispatchA* [line 76, column 3]\n *n$28._x:int=5 [line 76, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_5" [label="5: BinaryOperatorStmt: Assign \n n$29=*&a:DispatchA* [line 76, column 3]\n *n$29._x:int=5 [line 76, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_5" -> "dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_3" ;
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_6" [label="6: DeclStmt \n VARIABLE_DECLARED(a:DispatchA*); [line 75, column 3]\n n$29=_fun_DispatchA.dispatch_a_block_variable_from_macro() [line 75, column 18]\n *&a:DispatchA*=n$29 [line 75, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_6" [label="6: DeclStmt \n VARIABLE_DECLARED(a:DispatchA*); [line 75, column 3]\n n$30=_fun_DispatchA.dispatch_a_block_variable_from_macro() [line 75, column 18]\n *&a:DispatchA*=n$30 [line 75, column 3]\n " shape="box"]
"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_6" -> "dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_5" ;
@ -221,15 +221,15 @@ digraph cfg {
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_2" [label="2: Exit DispatchA.trans \n " color=yellow style=filled]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" [label="3: Return Stmt \n n$11=*&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.trans.sharedInstance:objc_object* [line 49, column 10]\n " shape="box"]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" [label="3: Return Stmt \n n$12=*&#GB<codetoanalyze/objc/shared/block/dispatch.m>$DispatchA.trans.sharedInstance:objc_object* [line 49, column 10]\n " shape="box"]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" -> "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" ;
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" [label="4: Return Stmt \n *&return:objc_object*=n$11 [line 49, column 3]\n " shape="box"]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" [label="4: Return Stmt \n *&return:objc_object*=n$12 [line 49, column 3]\n " shape="box"]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" -> "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_2" ;
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_5" [label="5: Call n$12 \n n$12=*&dummy_block:_fn_(*) [line 48, column 3]\n n$13=n$12() objc_block [line 48, column 3]\n " shape="box"]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_5" [label="5: Call n$13 \n n$13=*&dummy_block:_fn_(*) [line 48, column 3]\n n$14=n$13() objc_block [line 48, column 3]\n " shape="box"]
"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_5" -> "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" ;

Loading…
Cancel
Save