From c90bcf13203073aa44c775d7385e98a6782a2e9f Mon Sep 17 00:00:00 2001 From: Dulma Churchill Date: Mon, 20 Nov 2017 06:15:30 -0800 Subject: [PATCH] [objc] Model dispatch functions Reviewed By: ddino, jvillard Differential Revision: D6359807 fbshipit-source-id: b1a04de --- infer/models/objc/src/Dispatch.m | 48 ++++++++++++++++++ infer/models/objc/src/Dispatch_once.m | 21 ++++++++ infer/src/backend/SymExecBlocks.ml | 10 +++- infer/src/clang/CProcname.ml | 6 ++- infer/src/clang/cTrans.ml | 14 +----- infer/src/clang/cTrans_models.ml | 29 ++--------- infer/src/clang/cTrans_models.mli | 4 +- infer/src/clang/cTrans_utils.ml | 50 ------------------- infer/src/clang/cTrans_utils.mli | 2 - .../codetoanalyze/objc/errors/issues.exp | 5 +- .../objc/shared/block/dispatch.m | 4 +- .../objc/shared/block/dispatch.m.dot | 28 +++++------ .../objc/shared/block/dispatch_examples.m.dot | 32 ++++++------ .../objc/shared/block/dispatch_in_macro.m.dot | 2 +- 14 files changed, 126 insertions(+), 129 deletions(-) create mode 100644 infer/models/objc/src/Dispatch.m create mode 100644 infer/models/objc/src/Dispatch_once.m diff --git a/infer/models/objc/src/Dispatch.m b/infer/models/objc/src/Dispatch.m new file mode 100644 index 000000000..79954fae4 --- /dev/null +++ b/infer/models/objc/src/Dispatch.m @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2017 - present Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +#import + +void dispatch_async(dispatch_queue_t queue, dispatch_block_t block) { block(); } + +void dispatch_after(dispatch_time_t when, + dispatch_queue_t queue, + dispatch_block_t block) { + block(); +} + +void dispatch_group_async(dispatch_group_t group, + + dispatch_queue_t queue, + dispatch_block_t block) { + block(); +} + +long dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout) { + block(); +} + +void dispatch_barrier_async(dispatch_queue_t queue, dispatch_block_t block) { + block(); +} + +void dispatch_source_set_cancel_handler(dispatch_source_t source, + dispatch_block_t handler) { + block(); +} + +void dispatch_source_set_event_handler(dispatch_source_t source, + dispatch_block_t handler) { + block(); +} + +void dispatch_group_notify(dispatch_group_t group, + dispatch_queue_t queue, + dispatch_block_t block) { + block(); +} diff --git a/infer/models/objc/src/Dispatch_once.m b/infer/models/objc/src/Dispatch_once.m new file mode 100644 index 000000000..f5d853f84 --- /dev/null +++ b/infer/models/objc/src/Dispatch_once.m @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017 - present Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + + /* We model dispatch_once in a separate file rather than Dispatch.m because this code + doesn't compile together with Foundation. */ + +#import + +typedef void (^dispatch_block_t)(void); + +typedef long dispatch_once_t; + +static void _dispatch_once(dispatch_once_t* predicate, dispatch_block_t block) { + block(); +} diff --git a/infer/src/backend/SymExecBlocks.ml b/infer/src/backend/SymExecBlocks.ml index f9bf83fa9..a194541e8 100644 --- a/infer/src/backend/SymExecBlocks.ml +++ b/infer/src/backend/SymExecBlocks.ml @@ -42,7 +42,14 @@ let get_extended_args_for_method_with_block_analysis act_params = let resolve_method_with_block_args_and_analyze caller_pdesc pname act_params = - match Ondemand.get_proc_desc pname with + let pdesc_opt = + match Specs.get_summary pname with + | Some summary -> + Some (Specs.get_proc_desc summary) + | None -> + Ondemand.get_proc_desc pname + in + match pdesc_opt with | Some pdesc when Procdesc.is_defined pdesc && Int.equal (List.length (Procdesc.get_formals pdesc)) (List.length act_params) @@ -88,4 +95,3 @@ let resolve_method_with_block_args_and_analyze caller_pdesc pname act_params = None ) | _ -> None - diff --git a/infer/src/clang/CProcname.ml b/infer/src/clang/CProcname.ml index a70f452f5..be100549e 100644 --- a/infer/src/clang/CProcname.ml +++ b/infer/src/clang/CProcname.ml @@ -57,7 +57,11 @@ let mk_c_function translation_unit_context ?tenv name function_decl_info_opt = match function_decl_info_opt with | Some (decl_info, function_decl_info) -> ( match function_decl_info.Clang_ast_t.fdi_storage_class with - | Some "static" -> + | Some "static" + (* when we model static functions, we cannot take the file into account to + create a mangled name because the file of the model is different to the real file, + thus the model won't work *) + when not (CTrans_models.is_modelled_static_function (QualifiedCppName.to_qual_string name)) -> let file_opt = (fst decl_info.Clang_ast_t.di_source_range).Clang_ast_t.sl_file |> Option.map ~f:SourceFile.from_abs_path diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index c18162927..24ab6b290 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -1272,12 +1272,6 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s {res_trans_to_parent with exps= res_trans_call.exps} - and dispatch_function_trans trans_state stmt_info stmt_list n = - L.(debug Capture Verbose) "@\n Call to a dispatch function treated as special case...@\n" ; - let transformed_stmt = Ast_expressions.translate_dispatch_function stmt_info stmt_list n in - instruction trans_state transformed_stmt - - and compute_this_for_destructor_calls trans_state stmt_info class_ptr = let context = trans_state.context in let sil_loc = CLocation.get_sil_location stmt_info context in @@ -3058,12 +3052,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s arraySubscriptExpr_trans trans_state expr_info stmt_list | BinaryOperator (stmt_info, stmt_list, expr_info, binop_info) -> binaryOperator_trans_with_cond trans_state stmt_info stmt_list expr_info binop_info - | CallExpr (stmt_info, stmt_list, ei) -> ( - match is_dispatch_function stmt_list with - | Some block_arg_pos -> - dispatch_function_trans trans_state stmt_info stmt_list block_arg_pos - | None -> - callExpr_trans trans_state stmt_info stmt_list ei ) + | CallExpr (stmt_info, stmt_list, ei) -> + callExpr_trans trans_state stmt_info stmt_list ei | CXXMemberCallExpr (stmt_info, stmt_list, ei) -> cxxMemberCallExpr_trans trans_state stmt_info stmt_list ei | CXXOperatorCallExpr (stmt_info, stmt_list, ei) -> diff --git a/infer/src/clang/cTrans_models.ml b/infer/src/clang/cTrans_models.ml index cc6f0d222..26242aaa8 100644 --- a/infer/src/clang/cTrans_models.ml +++ b/infer/src/clang/cTrans_models.ml @@ -10,6 +10,10 @@ open! IStd open Objc_models +let is_modelled_static_function name = + let modelled_functions = ["_dispatch_once"] in + List.mem ~equal:String.equal modelled_functions name + let class_equal class_typename class_name = String.equal (Typ.Name.name class_typename) class_name let is_cf_non_null_alloc pname = @@ -178,28 +182,3 @@ let get_predefined_model_method_signature class_name method_name mk_procname lan let next_predefined f = function Some _ as x -> x | None -> f method_name mk_procname lang in None |> next_predefined (get_predefined_ms_stringWithUTF8String class_name) |> next_predefined (get_predefined_ms_is_kind_of_class class_name) - - -let dispatch_functions = - [ ("_dispatch_once", 1) - ; ("dispatch_async", 1) - ; ("dispatch_sync", 1) - ; ("dispatch_after", 2) - ; ("dispatch_group_async", 2) - ; ("dispatch_group_notify", 2) - ; ("dispatch_group_wait", 2) - ; ("dispatch_barrier_async", 1) - ; ("dispatch_source_set_cancel_handler", 1) - ; ("dispatch_source_set_event_handler", 1) ] - - -let is_dispatch_function_name function_name = - let rec is_dispatch functions = - match functions with - | [] -> - None - | (el, block_arg_pos) :: rest -> - if String.equal el function_name then Some (el, block_arg_pos) else is_dispatch rest - in - is_dispatch dispatch_functions - diff --git a/infer/src/clang/cTrans_models.mli b/infer/src/clang/cTrans_models.mli index 0b8809d49..4fed81bc6 100644 --- a/infer/src/clang/cTrans_models.mli +++ b/infer/src/clang/cTrans_models.mli @@ -9,6 +9,8 @@ open! IStd +val is_modelled_static_function : string -> bool + val is_cf_non_null_alloc : Typ.Procname.t -> bool val is_alloc : Typ.Procname.t -> bool @@ -45,5 +47,3 @@ val get_predefined_model_method_signature : Typ.Name.t -> string -> (Typ.Name.t -> string -> Typ.Procname.objc_cpp_method_kind -> Typ.Procname.t) -> CFrontend_config.clang_lang -> CMethod_signature.method_signature option - -val is_dispatch_function_name : string -> (string * int) option diff --git a/infer/src/clang/cTrans_utils.ml b/infer/src/clang/cTrans_utils.ml index 626d5f467..890484a04 100644 --- a/infer/src/clang/cTrans_utils.ml +++ b/infer/src/clang/cTrans_utils.ml @@ -771,56 +771,6 @@ let is_logical_negation_of_int tenv ei uoi = false -let rec is_block_stmt stmt = - let open Clang_ast_t in - match stmt with - | BlockExpr _ -> - true - | DeclRefExpr (_, _, expr_info, _) -> - let qt = expr_info.Clang_ast_t.ei_qual_type in - CType.is_block_type qt - | _ -> - match snd (Clang_ast_proj.get_stmt_tuple stmt) with - | [sub_stmt] -> - is_block_stmt sub_stmt - | _ -> - false - - -(* Checks if stmt_list is a call to a special dispatch function *) -let is_dispatch_function stmt_list = - let open Clang_ast_t in - let rec is_dispatch_function stmt arg_stmts = - match stmt with - | DeclRefExpr (_, _, _, di) -> ( - match di.Clang_ast_t.drti_decl_ref with - | None -> - None - | Some d -> - match (d.Clang_ast_t.dr_kind, d.Clang_ast_t.dr_name) with - | `Function, Some name_info - -> ( - let s = name_info.Clang_ast_t.ni_name in - match CTrans_models.is_dispatch_function_name s with - | None -> - None - | Some (_, block_arg_pos) -> - try - let arg_stmt = List.nth_exn arg_stmts block_arg_pos in - if is_block_stmt arg_stmt then Some block_arg_pos else None - with Invalid_argument _ -> None ) - | _ -> - None ) - | _ -> - match snd (Clang_ast_proj.get_stmt_tuple stmt) with - | [sub_stmt] -> - is_dispatch_function sub_stmt arg_stmts - | _ -> - None - in - match stmt_list with stmt :: arg_stmts -> is_dispatch_function stmt arg_stmts | _ -> None - - let is_block_enumerate_function mei = String.equal mei.Clang_ast_t.omei_selector CFrontend_config.enumerateObjectsUsingBlock diff --git a/infer/src/clang/cTrans_utils.mli b/infer/src/clang/cTrans_utils.mli index d6578c429..e84df25f7 100644 --- a/infer/src/clang/cTrans_utils.mli +++ b/infer/src/clang/cTrans_utils.mli @@ -211,6 +211,4 @@ end val is_logical_negation_of_int : Tenv.t -> Clang_ast_t.expr_info -> Clang_ast_t.unary_operator_info -> bool -val is_dispatch_function : Clang_ast_t.stmt list -> int option - val is_block_enumerate_function : Clang_ast_t.obj_c_message_expr_info -> bool diff --git a/infer/tests/codetoanalyze/objc/errors/issues.exp b/infer/tests/codetoanalyze/objc/errors/issues.exp index 2942094ed..6ea415d4d 100644 --- a/infer/tests/codetoanalyze/objc/errors/issues.exp +++ b/infer/tests/codetoanalyze/objc/errors/issues.exp @@ -3,7 +3,7 @@ codetoanalyze/objc/errors/global_const/global_const.m, SimpleRoot_doSomethingBad codetoanalyze/objc/errors/global_const/global_const.m, SimpleRoot_doSomethingOkWithDict:andString:, 3, NULL_DEREFERENCE, [start of procedure doSomethingOkWithDict:andString:,Message stringByAppendingString: with receiver nil returns nil.] codetoanalyze/objc/errors/initialization/compound_literal.c, init_with_compound_literal, 2, DIVIDE_BY_ZERO, [start of procedure init_with_compound_literal()] codetoanalyze/objc/errors/memory_leaks_benchmark/CADisplayLinkRetainCycle.m, testCycle, 3, RETAIN_CYCLE, [start of procedure testCycle(),start of procedure init,return from a call to CADisplay_init] -codetoanalyze/objc/errors/memory_leaks_benchmark/RetainCycleStaticVar.m, RetainCSVycleStaticVar, 2, MEMORY_LEAK, [start of procedure RetainCSVycleStaticVar(),start of procedure init,return from a call to RetainCSV_init,start of procedure foo,start of procedure block,start of procedure init,return from a call to RetainCSV_init,return from a call to objc_blockRetainCSV_foo_3,start of procedure block,start of procedure init,return from a call to RetainCSV_init,return from a call to objc_blockRetainCSV_foo_2,return from a call to RetainCSV_foo] +codetoanalyze/objc/errors/memory_leaks_benchmark/RetainCycleStaticVar.m, RetainCSVycleStaticVar, 2, MEMORY_LEAK, [start of procedure RetainCSVycleStaticVar(),start of procedure init,return from a call to RetainCSV_init,start of procedure foo,return from a call to RetainCSV_foo] codetoanalyze/objc/errors/npe/blockenum.m, BlockEnumA_allResultsList:, 1, MEMORY_LEAK, [start of procedure allResultsList:,Skipping init: function or method not found] codetoanalyze/objc/errors/npe/blockenum.m, BlockEnumA_foo1:, 2, MEMORY_LEAK, [start of procedure foo1:,Skipping init: function or method not found] codetoanalyze/objc/errors/npe/nil_param.m, NilParamMain, 4, MEMORY_LEAK, [start of procedure NilParamMain(),start of procedure test1:,Message test2 with receiver nil returns nil.,return from a call to NilParamA_test1:,Skipping release: function or method not found] @@ -95,6 +95,7 @@ codetoanalyze/objc/errors/npe/block.m, BlockA_foo7, 2, IVAR_NOT_NULL_CHECKED, [s codetoanalyze/objc/errors/npe/ivar_blocks.m, MyClass_ivar_npe, 1, IVAR_NOT_NULL_CHECKED, [start of procedure ivar_npe] codetoanalyze/objc/errors/npe/skip_method_with_nil_object.m, SkipMethodNilA_testBug:, 6, PARAMETER_NOT_NULL_CHECKED, [start of procedure testBug:,Message get_a with receiver nil returns nil.,Message skip_method with receiver nil returns nil.,Condition is false] codetoanalyze/objc/errors/property/main.c, property_main, 3, MEMORY_LEAK, [start of procedure property_main(),Skipping aProperty: function or method not found] +codetoanalyze/objc/errors/resource_leaks/Dispatch_sources.m, ProcessContentsOfFile, 35, RESOURCE_LEAK, [start of procedure ProcessContentsOfFile(),Condition is false,Skipping dispatch_get_global_queue(): function or method not found,Skipping dispatch_source_create(): function or method not found,Condition is false] codetoanalyze/objc/errors/resource_leaks/Dispatch_sources.m, objc_blockProcessContentsOfFile_2, 6, MEMORY_LEAK, [start of procedure block,Skipping dispatch_source_get_data(): function or method not found,Condition is true,Skipping MyProcessFileData(): function or method not found] codetoanalyze/objc/errors/resource_leaks/ResourceLeakExample.m, NSFileHandle_fileHandleForLoggingAtPath:mode:, 9, RESOURCE_LEAK, [start of procedure fileHandleForLoggingAtPath:mode:,Condition is true,Skipping fileSystemRepresentation: function or method not found,Condition is false,Condition is true,Skipping autorelease: function or method not found] codetoanalyze/objc/shared/annotations/nonnull_annotations.m, A_test1:, 2, PARAMETER_NOT_NULL_CHECKED, [start of procedure test1:,Message child with receiver nil returns nil.] @@ -102,7 +103,7 @@ codetoanalyze/objc/shared/annotations/nonnull_annotations.m, A_test3:, 1, PARAME codetoanalyze/objc/shared/annotations/nullable_annotations.m, User_otherUserName, 2, NULL_DEREFERENCE, [start of procedure otherUserName,Skipping otherUser: function or method not found] codetoanalyze/objc/shared/annotations/nullable_annotations.m, npe_property_nullable, 3, NULL_DEREFERENCE, [start of procedure npe_property_nullable(),Skipping child: function or method not found] codetoanalyze/objc/shared/annotations/nullable_annotations_fields.m, A_nullable_field, 3, NULL_DEREFERENCE, [start of procedure nullable_field,Skipping getA(): function or method not found] -codetoanalyze/objc/shared/block/dispatch.m, DispatchA_dispatch_a_block_variable_from_macro_delivers_initialised_object, 3, DIVIDE_BY_ZERO, [start of procedure dispatch_a_block_variable_from_macro_delivers_initialised_object,start of procedure dispatch_a_block_variable_from_macro,start of procedure block,start of procedure init,return from a call to DispatchA_init,return from a call to objc_blockDispatchA_dispatch_a_block_variable_from_macro_4,return from a call to DispatchA_dispatch_a_block_variable_from_macro] +codetoanalyze/objc/shared/block/dispatch.m, DispatchA_dispatch_a_block_variable_from_macro_delivers_initialised_object, 3, DIVIDE_BY_ZERO, [start of procedure dispatch_a_block_variable_from_macro_delivers_initialised_object,start of procedure dispatch_a_block_variable_from_macro,Skipping _dispatch_once(): function or method not found,return from a call to DispatchA_dispatch_a_block_variable_from_macro] codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_blockCapturedVarLeak, 3, MEMORY_LEAK, [start of procedure blockCapturedVarLeak] codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_blockFreeNoLeakTODO, 3, MEMORY_LEAK, [start of procedure blockFreeNoLeakTODO] codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_createCloseCrossGlyph:, 2, MEMORY_LEAK, [start of procedure createCloseCrossGlyph:,Skipping CGRectGetHeight(): function or method not found] diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m index 405d2ee77..d2b123074 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m @@ -48,7 +48,7 @@ static_storage__ = ([self new]); }; static dispatch_once_t once_token__; - _dispatch_once(&once_token__, initialization_block__); + dispatch_once(&once_token__, initialization_block__); return static_storage__; } @@ -59,7 +59,7 @@ static_storage__ = ([self new]); }; static dispatch_once_t once_token__; - _dispatch_once(&once_token__, initialization_block__); + dispatch_once(&once_token__, initialization_block__); static_storage__; }); } diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot index 7d249c933..37bb393ec 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch.m.dot @@ -11,7 +11,7 @@ digraph iCFG { "sharedInstance#DispatchA#class.8992c6086d1ce5c225093940f62386ac_3" -> "sharedInstance#DispatchA#class.8992c6086d1ce5c225093940f62386ac_2" ; -"sharedInstance#DispatchA#class.8992c6086d1ce5c225093940f62386ac_4" [label="4: Call (_fun_objc_blockDispatchA_sharedInstance_1) \n n$4=(_fun_objc_blockDispatchA_sharedInstance_1)() [line 30, column 3]\n " shape="box"] +"sharedInstance#DispatchA#class.8992c6086d1ce5c225093940f62386ac_4" [label="4: Call _fun__dispatch_once \n _fun__dispatch_once(&#GB$DispatchA_sharedInstance_once:long*,(_fun_objc_blockDispatchA_sharedInstance_1):_fn_(*)) block_params [line 30, column 3]\n " shape="box"] "sharedInstance#DispatchA#class.8992c6086d1ce5c225093940f62386ac_4" -> "sharedInstance#DispatchA#class.8992c6086d1ce5c225093940f62386ac_3" ; @@ -33,11 +33,11 @@ digraph iCFG { "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$5=*&#GB$DispatchA_trans_sharedInstance:objc_object* [line 42, column 10]\n *&return:objc_object*=n$5 [line 42, column 3]\n " shape="box"] +"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" [label="3: Return Stmt \n n$4=*&#GB$DispatchA_trans_sharedInstance:objc_object* [line 42, column 10]\n *&return:objc_object*=n$4 [line 42, column 3]\n " shape="box"] "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" -> "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_2" ; -"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" [label="4: Call n$6 \n n$6=*&dummy_block:_fn_(*) [line 41, column 3]\n n$6() [line 41, column 3]\n " shape="box"] +"trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" [label="4: Call n$5 \n n$5=*&dummy_block:_fn_(*) [line 41, column 3]\n n$5() [line 41, column 3]\n " shape="box"] "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_4" -> "trans#DispatchA#class.23f9d908a87deca79c235bc76ca6e941_3" ; @@ -52,7 +52,7 @@ digraph iCFG { "objc_blockDispatchA_trans_2.3e9844ebda3bff9e63047261f5667152_2" [label="2: Exit objc_blockDispatchA_trans_2 \n " color=yellow style=filled] -"objc_blockDispatchA_trans_2.3e9844ebda3bff9e63047261f5667152_3" [label="3: BinaryOperatorStmt: Assign \n n$7=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 39, column 23]\n n$8=_fun_DispatchA_init(n$7:DispatchA*) virtual [line 39, column 22]\n *&#GB$DispatchA_trans_sharedInstance:objc_object*=n$8 [line 39, column 5]\n " shape="box"] +"objc_blockDispatchA_trans_2.3e9844ebda3bff9e63047261f5667152_3" [label="3: BinaryOperatorStmt: Assign \n n$6=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 39, column 23]\n n$7=_fun_DispatchA_init(n$6:DispatchA*) virtual [line 39, column 22]\n *&#GB$DispatchA_trans_sharedInstance:objc_object*=n$7 [line 39, column 5]\n " shape="box"] "objc_blockDispatchA_trans_2.3e9844ebda3bff9e63047261f5667152_3" -> "objc_blockDispatchA_trans_2.3e9844ebda3bff9e63047261f5667152_2" ; @@ -63,11 +63,11 @@ digraph iCFG { "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$9=*&#GB$DispatchA_dispatch_a_block_variable_static_storage__:objc_object* [line 52, column 10]\n *&return:objc_object*=n$9 [line 52, column 3]\n " shape="box"] +"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" [label="3: Return Stmt \n n$8=*&#GB$DispatchA_dispatch_a_block_variable_static_storage__:objc_object* [line 52, column 10]\n *&return:objc_object*=n$8 [line 52, column 3]\n " shape="box"] "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" -> "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_2" ; -"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" [label="4: Call n$10 \n n$10=*&initialization_block__:_fn_(*) [line 51, column 33]\n n$11=n$10() [line 51, column 3]\n " shape="box"] +"dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" [label="4: Call _fun__dispatch_once \n n$9=*&initialization_block__:_fn_(*) [line 51, column 32]\n _fun__dispatch_once(&#GB$DispatchA_dispatch_a_block_variable_once_token__:long*,n$9:_fn_(*)) [line 51, column 3]\n " shape="box"] "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_4" -> "dispatch_a_block_variable#DispatchA#class.3cc12dd22127281b8293b7c046d21bb2_3" ; @@ -82,7 +82,7 @@ digraph iCFG { "objc_blockDispatchA_dispatch_a_block_variable_3.09c6b14692ef67057c46de6cee569440_2" [label="2: Exit objc_blockDispatchA_dispatch_a_block_variable_3 \n " color=yellow style=filled] -"objc_blockDispatchA_dispatch_a_block_variable_3.09c6b14692ef67057c46de6cee569440_3" [label="3: BinaryOperatorStmt: Assign \n n$12=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 48, column 25]\n n$13=_fun_DispatchA_init(n$12:DispatchA*) virtual [line 48, column 25]\n *&#GB$DispatchA_dispatch_a_block_variable_static_storage__:objc_object*=n$13 [line 48, column 5]\n " shape="box"] +"objc_blockDispatchA_dispatch_a_block_variable_3.09c6b14692ef67057c46de6cee569440_3" [label="3: BinaryOperatorStmt: Assign \n n$10=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 48, column 25]\n n$11=_fun_DispatchA_init(n$10:DispatchA*) virtual [line 48, column 25]\n *&#GB$DispatchA_dispatch_a_block_variable_static_storage__:objc_object*=n$11 [line 48, column 5]\n " shape="box"] "objc_blockDispatchA_dispatch_a_block_variable_3.09c6b14692ef67057c46de6cee569440_3" -> "objc_blockDispatchA_dispatch_a_block_variable_3.09c6b14692ef67057c46de6cee569440_2" ; @@ -93,11 +93,11 @@ digraph iCFG { "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: Fallback node \n n$14=*&#GB$DispatchA_dispatch_a_block_variable_from_macro_static_storage__:objc_object* [line 63, column 5]\n " shape="box"] +"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_3" [label="3: Fallback node \n n$12=*&#GB$DispatchA_dispatch_a_block_variable_from_macro_static_storage__:objc_object* [line 63, 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 n$15 \n n$15=*&initialization_block__:_fn_(*) [line 62, column 35]\n n$16=n$15() [line 62, column 5]\n " shape="box"] +"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_4" [label="4: Call _fun__dispatch_once \n n$13=*&initialization_block__:_fn_(*) [line 62, column 34]\n _fun__dispatch_once(&#GB$DispatchA_dispatch_a_block_variable_from_macro_once_token__:long*,n$13:_fn_(*)) [line 62, 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" ; @@ -105,7 +105,7 @@ digraph iCFG { "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$14 [line 56, column 3]\n " shape="box"] +"dispatch_a_block_variable_from_macro#DispatchA#class.92567a38d5ab3cf637f72030b1097441_6" [label="6: Return Stmt \n *&return:objc_object*=n$12 [line 56, 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" ; @@ -116,7 +116,7 @@ digraph iCFG { "objc_blockDispatchA_dispatch_a_block_variable_from_macro_4.cdb7f792f8c2689b337db5fca633647f_2" [label="2: Exit objc_blockDispatchA_dispatch_a_block_variable_from_macro_4 \n " color=yellow style=filled] -"objc_blockDispatchA_dispatch_a_block_variable_from_macro_4.cdb7f792f8c2689b337db5fca633647f_3" [label="3: BinaryOperatorStmt: Assign \n n$17=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 59, column 27]\n n$18=_fun_DispatchA_init(n$17:DispatchA*) virtual [line 59, column 27]\n *&#GB$DispatchA_dispatch_a_block_variable_from_macro_static_storage__:objc_object*=n$18 [line 59, column 7]\n " shape="box"] +"objc_blockDispatchA_dispatch_a_block_variable_from_macro_4.cdb7f792f8c2689b337db5fca633647f_3" [label="3: BinaryOperatorStmt: Assign \n n$14=_fun___objc_alloc_no_fail(sizeof(t=DispatchA):unsigned long) [line 59, column 27]\n n$15=_fun_DispatchA_init(n$14:DispatchA*) virtual [line 59, column 27]\n *&#GB$DispatchA_dispatch_a_block_variable_from_macro_static_storage__:objc_object*=n$15 [line 59, column 7]\n " shape="box"] "objc_blockDispatchA_dispatch_a_block_variable_from_macro_4.cdb7f792f8c2689b337db5fca633647f_3" -> "objc_blockDispatchA_dispatch_a_block_variable_from_macro_4.cdb7f792f8c2689b337db5fca633647f_2" ; @@ -127,15 +127,15 @@ digraph iCFG { "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$19=*&a:DispatchA* [line 70, column 15]\n n$20=*n$19._x:int [line 70, column 15]\n *&return:int=(1 / (n$20 - 5)) [line 70, column 3]\n " shape="box"] +"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_3" [label="3: Return Stmt \n n$16=*&a:DispatchA* [line 70, column 15]\n n$17=*n$16._x:int [line 70, column 15]\n *&return:int=(1 / (n$17 - 5)) [line 70, column 3]\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_2" ; -"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_4" [label="4: BinaryOperatorStmt: Assign \n n$21=*&a:DispatchA* [line 69, column 3]\n *n$21._x:int=5 [line 69, column 3]\n " shape="box"] +"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_4" [label="4: BinaryOperatorStmt: Assign \n n$18=*&a:DispatchA* [line 69, column 3]\n *n$18._x:int=5 [line 69, 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_3" ; -"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_5" [label="5: DeclStmt \n n$22=_fun_DispatchA_dispatch_a_block_variable_from_macro() [line 68, column 18]\n *&a:DispatchA*=n$22 [line 68, column 3]\n " shape="box"] +"dispatch_a_block_variable_from_macro_delivers_initialised_object#DispatchA#class.a58ef5afb5e1e9480b49788e2400c52c_5" [label="5: DeclStmt \n n$19=_fun_DispatchA_dispatch_a_block_variable_from_macro() [line 68, column 18]\n *&a:DispatchA*=n$19 [line 68, 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_4" ; diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot b/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot index 7afa3e090..6559722fd 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch_examples.m.dot @@ -11,7 +11,7 @@ digraph iCFG { "dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_3" -> "dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_2" ; -"dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_4" [label="4: Call (_fun_objc_blockDispatchEx_dispatch_once_example_1) \n n$6=(_fun_objc_blockDispatchEx_dispatch_once_example_1)() [line 29, column 3]\n " shape="box"] +"dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_4" [label="4: Call _fun__dispatch_once \n _fun__dispatch_once(&#GB$DispatchEx_dispatch_once_example_onceToken:long*,(_fun_objc_blockDispatchEx_dispatch_once_example_1):_fn_(*)) block_params [line 29, column 3]\n " shape="box"] "dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_4" -> "dispatch_once_example#DispatchEx#class.d3456446b1a2d5355c1767887cc8b62c_3" ; @@ -41,11 +41,11 @@ digraph iCFG { "dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_2" [label="2: Exit DispatchEx_dispatch_async_example \n " color=yellow style=filled] -"dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_3" [label="3: Return Stmt \n n$7=*&#GB$DispatchEx_dispatch_async_example_a:DispatchEx* [line 43, column 10]\n n$8=*n$7.x:int [line 43, column 10]\n *&return:int=n$8 [line 43, column 3]\n " shape="box"] +"dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_3" [label="3: Return Stmt \n n$6=*&#GB$DispatchEx_dispatch_async_example_a:DispatchEx* [line 43, column 10]\n n$7=*n$6.x:int [line 43, column 10]\n *&return:int=n$7 [line 43, column 3]\n " shape="box"] "dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_3" -> "dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_2" ; -"dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_4" [label="4: Call (_fun_objc_blockDispatchEx_dispatch_async_example_2) \n n$12=(_fun_objc_blockDispatchEx_dispatch_async_example_2)() [line 38, column 3]\n " shape="box"] +"dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_4" [label="4: Call _fun_dispatch_async \n n$8=_fun_dispatch_get_global_queue(0:long,0:unsigned long) [line 38, column 18]\n _fun_dispatch_async(n$8:NSObject*,(_fun_objc_blockDispatchEx_dispatch_async_example_2):_fn_(*)) block_params [line 38, column 3]\n " shape="box"] "dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_4" -> "dispatch_async_example#DispatchEx#class.5c5d7347be2a9654ad7e32514189fe54_3" ; @@ -75,11 +75,11 @@ digraph iCFG { "dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_2" [label="2: Exit DispatchEx_dispatch_after_example \n " color=yellow style=filled] -"dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_3" [label="3: Return Stmt \n n$13=*&#GB$DispatchEx_dispatch_after_example_a:DispatchEx* [line 54, column 10]\n n$14=*n$13.x:int [line 54, column 10]\n *&return:int=n$14 [line 54, column 3]\n " shape="box"] +"dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_3" [label="3: Return Stmt \n n$12=*&#GB$DispatchEx_dispatch_after_example_a:DispatchEx* [line 54, column 10]\n n$13=*n$12.x:int [line 54, column 10]\n *&return:int=n$13 [line 54, column 3]\n " shape="box"] "dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_3" -> "dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_2" ; -"dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_4" [label="4: Call (_fun_objc_blockDispatchEx_dispatch_after_example_3) \n n$18=(_fun_objc_blockDispatchEx_dispatch_after_example_3)() [line 48, column 3]\n " shape="box"] +"dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_4" [label="4: Call _fun_dispatch_after \n n$14=_fun_dispatch_time(0:unsigned long long,(2 * 1000000000):long long) [line 48, column 18]\n n$15=_fun_dispatch_get_main_queue() [line 49, column 18]\n _fun_dispatch_after(n$14:unsigned long long,n$15:NSObject*,(_fun_objc_blockDispatchEx_dispatch_after_example_3):_fn_(*)) block_params [line 48, column 3]\n " shape="box"] "dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_4" -> "dispatch_after_example#DispatchEx#class.1d25856bd99eb1ef683c8f65ff46d05d_3" ; @@ -94,11 +94,11 @@ digraph iCFG { "objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_2" [label="2: Exit objc_blockDispatchEx_dispatch_after_example_3 \n " color=yellow style=filled] -"objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_3" [label="3: BinaryOperatorStmt: Assign \n n$15=*&#GB$DispatchEx_dispatch_after_example_a:DispatchEx* [line 52, column 20]\n *n$15.x:int=10 [line 52, column 20]\n " shape="box"] +"objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_3" [label="3: BinaryOperatorStmt: Assign \n n$16=*&#GB$DispatchEx_dispatch_after_example_a:DispatchEx* [line 52, column 20]\n *n$16.x:int=10 [line 52, column 20]\n " shape="box"] "objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_3" -> "objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_2" ; -"objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_4" [label="4: BinaryOperatorStmt: Assign \n n$16=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 51, column 25]\n n$17=_fun_DispatchEx_init(n$16:DispatchEx*) virtual [line 51, column 24]\n *&#GB$DispatchEx_dispatch_after_example_a:DispatchEx*=n$17 [line 51, column 20]\n " shape="box"] +"objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_4" [label="4: BinaryOperatorStmt: Assign \n n$17=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 51, column 25]\n n$18=_fun_DispatchEx_init(n$17:DispatchEx*) virtual [line 51, column 24]\n *&#GB$DispatchEx_dispatch_after_example_a:DispatchEx*=n$18 [line 51, column 20]\n " shape="box"] "objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_4" -> "objc_blockDispatchEx_dispatch_after_example_3.380a17f45400d49d71ce1ba1c29a6ba4_3" ; @@ -113,7 +113,7 @@ digraph iCFG { "dispatch_group_example#DispatchEx#class.f420a75c58eda6d3f0e5e05fadabfc18_3" -> "dispatch_group_example#DispatchEx#class.f420a75c58eda6d3f0e5e05fadabfc18_2" ; -"dispatch_group_example#DispatchEx#class.f420a75c58eda6d3f0e5e05fadabfc18_4" [label="4: Call (_fun_objc_blockDispatchEx_dispatch_group_example_4) \n n$24=(_fun_objc_blockDispatchEx_dispatch_group_example_4)() [line 59, column 3]\n " shape="box"] +"dispatch_group_example#DispatchEx#class.f420a75c58eda6d3f0e5e05fadabfc18_4" [label="4: Call _fun_dispatch_group_async \n n$21=_fun_dispatch_get_main_queue() [line 59, column 30]\n _fun_dispatch_group_async(null:NSObject*,n$21:NSObject*,(_fun_objc_blockDispatchEx_dispatch_group_example_4):_fn_(*)) block_params [line 59, column 3]\n " shape="box"] "dispatch_group_example#DispatchEx#class.f420a75c58eda6d3f0e5e05fadabfc18_4" -> "dispatch_group_example#DispatchEx#class.f420a75c58eda6d3f0e5e05fadabfc18_3" ; @@ -128,11 +128,11 @@ digraph iCFG { "objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_2" [label="2: Exit objc_blockDispatchEx_dispatch_group_example_4 \n " color=yellow style=filled] -"objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_3" [label="3: BinaryOperatorStmt: Assign \n n$21=*&#GB$DispatchEx_dispatch_group_example_a:DispatchEx* [line 61, column 5]\n *n$21.x:int=10 [line 61, column 5]\n " shape="box"] +"objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_3" [label="3: BinaryOperatorStmt: Assign \n n$22=*&#GB$DispatchEx_dispatch_group_example_a:DispatchEx* [line 61, column 5]\n *n$22.x:int=10 [line 61, column 5]\n " shape="box"] "objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_3" -> "objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_2" ; -"objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_4" [label="4: BinaryOperatorStmt: Assign \n n$22=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 60, column 10]\n n$23=_fun_DispatchEx_init(n$22:DispatchEx*) virtual [line 60, column 9]\n *&#GB$DispatchEx_dispatch_group_example_a:DispatchEx*=n$23 [line 60, column 5]\n " shape="box"] +"objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_4" [label="4: BinaryOperatorStmt: Assign \n n$23=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 60, column 10]\n n$24=_fun_DispatchEx_init(n$23:DispatchEx*) virtual [line 60, column 9]\n *&#GB$DispatchEx_dispatch_group_example_a:DispatchEx*=n$24 [line 60, column 5]\n " shape="box"] "objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_4" -> "objc_blockDispatchEx_dispatch_group_example_4.65d6b4827e06dfbede68939492105a46_3" ; @@ -147,7 +147,7 @@ digraph iCFG { "dispatch_group_notify_example#DispatchEx#class.f5cf54b07621c319cf7ead3b217760ed_3" -> "dispatch_group_notify_example#DispatchEx#class.f5cf54b07621c319cf7ead3b217760ed_2" ; -"dispatch_group_notify_example#DispatchEx#class.f5cf54b07621c319cf7ead3b217760ed_4" [label="4: Call (_fun_objc_blockDispatchEx_dispatch_group_notify_example_5) \n n$30=(_fun_objc_blockDispatchEx_dispatch_group_notify_example_5)() [line 68, column 3]\n " shape="box"] +"dispatch_group_notify_example#DispatchEx#class.f5cf54b07621c319cf7ead3b217760ed_4" [label="4: Call _fun_dispatch_group_async \n n$27=_fun_dispatch_get_main_queue() [line 68, column 30]\n _fun_dispatch_group_async(null:NSObject*,n$27:NSObject*,(_fun_objc_blockDispatchEx_dispatch_group_notify_example_5):_fn_(*)) block_params [line 68, column 3]\n " shape="box"] "dispatch_group_notify_example#DispatchEx#class.f5cf54b07621c319cf7ead3b217760ed_4" -> "dispatch_group_notify_example#DispatchEx#class.f5cf54b07621c319cf7ead3b217760ed_3" ; @@ -162,11 +162,11 @@ digraph iCFG { "objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_2" [label="2: Exit objc_blockDispatchEx_dispatch_group_notify_example_5 \n " color=yellow style=filled] -"objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_3" [label="3: BinaryOperatorStmt: Assign \n n$27=*&#GB$DispatchEx_dispatch_group_notify_example_a:DispatchEx* [line 70, column 5]\n *n$27.x:int=10 [line 70, column 5]\n " shape="box"] +"objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_3" [label="3: BinaryOperatorStmt: Assign \n n$28=*&#GB$DispatchEx_dispatch_group_notify_example_a:DispatchEx* [line 70, column 5]\n *n$28.x:int=10 [line 70, column 5]\n " shape="box"] "objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_3" -> "objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_2" ; -"objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_4" [label="4: BinaryOperatorStmt: Assign \n n$28=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 69, column 10]\n n$29=_fun_DispatchEx_init(n$28:DispatchEx*) virtual [line 69, column 9]\n *&#GB$DispatchEx_dispatch_group_notify_example_a:DispatchEx*=n$29 [line 69, column 5]\n " shape="box"] +"objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_4" [label="4: BinaryOperatorStmt: Assign \n n$29=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 69, column 10]\n n$30=_fun_DispatchEx_init(n$29:DispatchEx*) virtual [line 69, column 9]\n *&#GB$DispatchEx_dispatch_group_notify_example_a:DispatchEx*=n$30 [line 69, column 5]\n " shape="box"] "objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_4" -> "objc_blockDispatchEx_dispatch_group_notify_example_5.ded89d749d973a9d57680f9d68afb8a0_3" ; @@ -181,7 +181,7 @@ digraph iCFG { "dispatch_barrier_example#DispatchEx#class.a541a40f2f04e29019c58e563f7544d8_3" -> "dispatch_barrier_example#DispatchEx#class.a541a40f2f04e29019c58e563f7544d8_2" ; -"dispatch_barrier_example#DispatchEx#class.a541a40f2f04e29019c58e563f7544d8_4" [label="4: Call (_fun_objc_blockDispatchEx_dispatch_barrier_example_6) \n n$36=(_fun_objc_blockDispatchEx_dispatch_barrier_example_6)() [line 77, column 3]\n " shape="box"] +"dispatch_barrier_example#DispatchEx#class.a541a40f2f04e29019c58e563f7544d8_4" [label="4: Call _fun_dispatch_barrier_async \n n$33=_fun_dispatch_get_main_queue() [line 77, column 26]\n _fun_dispatch_barrier_async(n$33:NSObject*,(_fun_objc_blockDispatchEx_dispatch_barrier_example_6):_fn_(*)) block_params [line 77, column 3]\n " shape="box"] "dispatch_barrier_example#DispatchEx#class.a541a40f2f04e29019c58e563f7544d8_4" -> "dispatch_barrier_example#DispatchEx#class.a541a40f2f04e29019c58e563f7544d8_3" ; @@ -196,11 +196,11 @@ digraph iCFG { "objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_2" [label="2: Exit objc_blockDispatchEx_dispatch_barrier_example_6 \n " color=yellow style=filled] -"objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_3" [label="3: BinaryOperatorStmt: Assign \n n$33=*&#GB$DispatchEx_dispatch_barrier_example_a:DispatchEx* [line 79, column 5]\n *n$33.x:int=10 [line 79, column 5]\n " shape="box"] +"objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_3" [label="3: BinaryOperatorStmt: Assign \n n$34=*&#GB$DispatchEx_dispatch_barrier_example_a:DispatchEx* [line 79, column 5]\n *n$34.x:int=10 [line 79, column 5]\n " shape="box"] "objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_3" -> "objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_2" ; -"objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_4" [label="4: BinaryOperatorStmt: Assign \n n$34=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 78, column 10]\n n$35=_fun_DispatchEx_init(n$34:DispatchEx*) virtual [line 78, column 9]\n *&#GB$DispatchEx_dispatch_barrier_example_a:DispatchEx*=n$35 [line 78, column 5]\n " shape="box"] +"objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_4" [label="4: BinaryOperatorStmt: Assign \n n$35=_fun___objc_alloc_no_fail(sizeof(t=DispatchEx):unsigned long) [line 78, column 10]\n n$36=_fun_DispatchEx_init(n$35:DispatchEx*) virtual [line 78, column 9]\n *&#GB$DispatchEx_dispatch_barrier_example_a:DispatchEx*=n$36 [line 78, column 5]\n " shape="box"] "objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_4" -> "objc_blockDispatchEx_dispatch_barrier_example_6.644987ff1e6d0e0008d4ccdb7e8538ee_3" ; diff --git a/infer/tests/codetoanalyze/objc/shared/block/dispatch_in_macro.m.dot b/infer/tests/codetoanalyze/objc/shared/block/dispatch_in_macro.m.dot index ef401c095..48abe3cce 100644 --- a/infer/tests/codetoanalyze/objc/shared/block/dispatch_in_macro.m.dot +++ b/infer/tests/codetoanalyze/objc/shared/block/dispatch_in_macro.m.dot @@ -11,7 +11,7 @@ digraph iCFG { "DispatchInMacroTest.f5d56763274a479d06265a2f9562bef1_3" -> "DispatchInMacroTest.f5d56763274a479d06265a2f9562bef1_5" ; -"DispatchInMacroTest.f5d56763274a479d06265a2f9562bef1_4" [label="4: Call (_fun_objc_blockDispatchInMacroTest_1) \n n$3=(_fun_objc_blockDispatchInMacroTest_1)() [line 23, column 10]\n " shape="box"] +"DispatchInMacroTest.f5d56763274a479d06265a2f9562bef1_4" [label="4: Call _fun__dispatch_once \n _fun__dispatch_once(&#GB$DispatchInMacroTest_once_token:long*,(_fun_objc_blockDispatchInMacroTest_1):_fn_(*)) block_params [line 23, column 10]\n " shape="box"] "DispatchInMacroTest.f5d56763274a479d06265a2f9562bef1_4" -> "DispatchInMacroTest.f5d56763274a479d06265a2f9562bef1_3" ;