diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index a5c773292..ef3d3cfab 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -192,9 +192,6 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s let collect_exprs res_trans_list = List.concat_map ~f:(fun res_trans -> res_trans.exps) res_trans_list - let collect_initid_exprs res_trans_list = - List.concat_map ~f:(fun res_trans -> res_trans.initd_exps) res_trans_list - (* If e is a block and the calling node has the priority then *) (* we need to release the priority to allow*) (* creation of nodes inside the block.*) @@ -437,12 +434,47 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s | _ -> empty_res_trans - let implicitValueInitExpr_trans trans_state expr_info = - let var_exp, _ = extract_var_exp_or_fail trans_state in + (** Create instructions to initialize record with zeroes. It needs to traverse + whole type structure, to assign 0 values to all transitive fields because of + AST construction in C translation *) + let implicitValueInitExpr_trans trans_state stmt_info = + (* This node will always be child of InitListExpr, claiming priority will always fail *) + let var_exp_typ = extract_var_exp_or_fail trans_state in let tenv = trans_state.context.CContext.tenv in - let typ = CType_decl.get_type_from_expr_info expr_info trans_state.context.CContext.tenv in - let exps = var_or_zero_in_init_list tenv var_exp typ ~return_zero:true in - {empty_res_trans with exps} + let sil_loc = CLocation.get_sil_location stmt_info trans_state.context in + let flatten_res_trans = collect_res_trans trans_state.context.procdesc in + (* Traverse structure of a type and initialize int/float/ptr fields with zero *) + let rec fill_typ_with_zero (exp, typ) : trans_result = + match typ.Typ.desc with + | Tstruct tn + -> let field_exps = + match Tenv.lookup tenv tn with + | Some {fields} + -> List.filter_map fields ~f:(fun (fieldname, fieldtype, _) -> + if Typ.Fieldname.is_hidden fieldname then None + else Some (Exp.Lfield (exp, fieldname, typ), fieldtype) ) + | None + -> assert false + in + List.map ~f:fill_typ_with_zero field_exps |> flatten_res_trans + | Tarray (field_typ, Some n, _) + -> let size = IntLit.to_int n in + let indices = CGeneral_utils.list_range 0 (size - 1) in + List.map indices ~f:(fun i -> + let idx_exp = Exp.Const (Const.Cint (IntLit.of_int i)) in + let field_exp = Exp.Lindex (exp, idx_exp) in + fill_typ_with_zero (field_exp, field_typ) ) + |> flatten_res_trans + | Tint _ | Tfloat _ | Tptr _ + -> let zero_exp = Sil.zero_value_of_numerical_type typ in + let instrs = [Sil.Store (exp, typ, zero_exp, sil_loc)] in + let exps = [(exp, typ)] in + {empty_res_trans with exps; instrs} + | Tfun _ | Tvoid | Tarray _ | TVar _ + -> assert false + in + let res_trans = fill_typ_with_zero var_exp_typ in + {res_trans with initd_exps= [fst var_exp_typ]} let no_op_trans succ_nodes = {empty_res_trans with root_nodes= succ_nodes} @@ -1891,73 +1923,88 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s let loop = Clang_ast_t.WhileStmt (stmt_info, [null_stmt; cond; body']) in instruction trans_state (Clang_ast_t.CompoundStmt (stmt_info, [assign_next_object; loop])) - and initListExpr_trans trans_state stmt_info expr_info stmts = + and initListExpr_array_trans trans_state stmt_info stmts var_exp field_typ = + let lh_exp idx = + let idx_exp = Exp.Const (Const.Cint (IntLit.of_int idx)) in + Exp.Lindex (var_exp, idx_exp) + in + let init_field idx stmt = + init_expr_trans trans_state (lh_exp idx, field_typ) stmt_info (Some stmt) + in + (* rest of fields when length(stmts) < size is ignored *) + List.mapi ~f:init_field stmts + + and initListExpr_struct_trans trans_state stmt_info stmts var_exp var_typ = let context = trans_state.context in let tenv = context.tenv in - let is_array typ = match typ.Typ.desc with Typ.Tarray _ -> true | _ -> false in - let var_exp, typ = + let tname = match var_typ.Typ.desc with Tstruct tname -> tname | _ -> assert false in + let field_exps = + match Tenv.lookup tenv tname with + | Some {fields} + -> List.filter_map fields ~f:(fun (fieldname, fieldtype, _) -> + if Typ.Fieldname.is_hidden fieldname then None + else Some (Exp.Lfield (var_exp, fieldname, var_typ), fieldtype) ) + | None + -> assert false + in + let init_field field_exp_typ stmt = + init_expr_trans trans_state field_exp_typ stmt_info (Some stmt) + in + List.map2_exn field_exps stmts ~f:init_field + + and initListExpr_builtin_trans trans_state stmt_info stmts var_exp var_typ = + let stmt = match stmts with [s] -> s | _ -> assert false in + [init_expr_trans trans_state (var_exp, var_typ) stmt_info (Some stmt)] + + (** InitListExpr can have following meanings: + - initialize all record fields + - initialize array + - initialize primitive type (int/flaot/pointer/...) + - perform zero initalization - http://en.cppreference.com/w/cpp/language/zero_initialization + Decision which case happens is based on the type of the InitListExpr + *) + and initListExpr_trans trans_state stmt_info expr_info stmts = + let var_exp, var_typ = match trans_state.var_exp_typ with | Some var_exp_typ -> var_exp_typ | None -> create_var_exp_tmp_var trans_state expr_info "SIL_init_list__" in - let trans_state = {trans_state with var_exp_typ= Some (var_exp, typ)} in - let trans_state_pri = PriorityNode.try_claim_priority_node trans_state stmt_info in - let sil_loc = CLocation.get_sil_location stmt_info context in - let var_type = - CType_decl.qual_type_to_sil_type context.CContext.tenv expr_info.Clang_ast_t.ei_qual_type - in - let lh = var_or_zero_in_init_list tenv var_exp var_type ~return_zero:false in - let res_trans_subexpr_list = - initListExpr_initializers_trans trans_state var_exp 0 stmts typ false stmt_info - in - let rh_exps = collect_exprs res_trans_subexpr_list in - if Int.equal (List.length rh_exps) 0 then + if Int.equal (List.length stmts) 0 then + (* perform zero initialization of a primitive type, record types will have + ImplicitValueInitExpr nodes *) let exps = - match Sil.zero_value_of_numerical_type_option var_type with + match Sil.zero_value_of_numerical_type_option var_typ with | Some zero_exp - -> [(zero_exp, typ)] + -> [(zero_exp, var_typ)] | None -> [] in {empty_res_trans with root_nodes= trans_state.succ_nodes; exps} else - (* For arrays, the size in the type may be an overapproximation of the number *) - (* of literals the array is initialized with *) - let lh = - if is_array var_type && List.length lh > List.length rh_exps then - List.take lh (List.length rh_exps) - else lh + let sil_loc = CLocation.get_sil_location stmt_info trans_state.context in + let trans_state_pri = PriorityNode.try_claim_priority_node trans_state stmt_info in + let init_stmt_info = + {stmt_info with Clang_ast_t.si_pointer= CAst_utils.get_fresh_pointer ()} in - if Int.equal (List.length rh_exps) (List.length lh) then - (* Creating new instructions by assigning right hand side to left hand side expressions *) - let assign_instr (lh_exp, lh_t) (rh_exp, _) = Sil.Store (lh_exp, lh_t, rh_exp, sil_loc) in - let assign_instrs = - let initd_exps = collect_initid_exprs res_trans_subexpr_list in - (* If the variable var_exp is of type array, and some of its indices were initialized *) - (* by some constructor call, which we can tell by the fact that the index is returned *) - (* in initd_exps, then we assume that all the indices were initialized and *) - (* we don't need any assignments. *) - if List.exists ~f:((fun arr index -> Exp.is_array_index_of index arr) var_exp) initd_exps - then [] - else List.map2_exn ~f:assign_instr lh rh_exps - in - let initlist_expr_res = - { empty_res_trans with - exps= [(var_exp, var_type)]; initd_exps= [var_exp]; instrs= assign_instrs } - in - let all_res_trans = res_trans_subexpr_list @ [initlist_expr_res] in - let nname = "InitListExp" in - let res_trans_to_parent = - PriorityNode.compute_results_to_parent trans_state_pri sil_loc nname stmt_info - all_res_trans - in - {res_trans_to_parent with exps= initlist_expr_res.exps} - else - (* If the right hand expressions are not as many as the left hand expressions *) - (* something's wrong *) - {empty_res_trans with root_nodes= trans_state.succ_nodes} + let all_res_trans = + match var_typ.Typ.desc with + | Typ.Tarray (typ_inside, _, _) + -> initListExpr_array_trans trans_state_pri init_stmt_info stmts var_exp typ_inside + | Typ.Tstruct _ + -> initListExpr_struct_trans trans_state_pri init_stmt_info stmts var_exp var_typ + | Tint _ | Tfloat _ | Tptr _ + -> initListExpr_builtin_trans trans_state_pri init_stmt_info stmts var_exp var_typ + | _ + -> assert false + in + let nname = "InitListExp" in + let res_trans = + PriorityNode.compute_results_to_parent trans_state_pri sil_loc nname stmt_info + all_res_trans + in + {res_trans with exps= [(var_exp, var_typ)]; initd_exps= [var_exp]} and init_dynamic_array trans_state array_exp_typ array_stmt_info dynlength_stmt_pointer = let dynlength_stmt = @@ -2449,44 +2496,6 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s | _ -> assert false - and initListExpr_initializers_trans trans_state var_exp n stmts typ is_dyn_array stmt_info = - let var_exp_inside, typ_inside = - match typ.Typ.desc with - | Typ.Tarray (t, _, _) when Typ.is_array_of_cpp_class typ - -> (Exp.Lindex (var_exp, Exp.Const (Const.Cint (IntLit.of_int n))), t) - | _ when is_dyn_array - -> (Exp.Lindex (var_exp, Exp.Const (Const.Cint (IntLit.of_int n))), typ) - | _ - -> (var_exp, typ) - in - let trans_state' = {trans_state with var_exp_typ= Some (var_exp_inside, typ_inside)} in - match stmts with - | [] - -> [] - | stmt :: rest - -> let rest_stmts_res_trans = - initListExpr_initializers_trans trans_state var_exp (n + 1) rest typ is_dyn_array - stmt_info - in - match stmt with - | Clang_ast_t.InitListExpr (_, stmts, _) - -> let inside_stmts_res_trans = - initListExpr_initializers_trans trans_state var_exp_inside 0 stmts typ_inside - is_dyn_array stmt_info - in - inside_stmts_res_trans @ rest_stmts_res_trans - | _ - -> let stmt_res_trans = - if is_dyn_array then - let init_stmt_info = - {stmt_info with Clang_ast_t.si_pointer= CAst_utils.get_fresh_pointer ()} - in - init_expr_trans trans_state' (var_exp_inside, typ_inside) init_stmt_info - (Some stmt) - else instruction trans_state' stmt - in - stmt_res_trans :: rest_stmts_res_trans - and lambdaExpr_trans trans_state expr_info {Clang_ast_t.lei_lambda_decl; lei_captures} = let open CContext in let qual_type = expr_info.Clang_ast_t.ei_qual_type in @@ -2539,7 +2548,10 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s let trans_state_init = {trans_state_pri with succ_nodes= []} in let var_exp_typ = match res_trans_new.exps with - | [(var_exp, {Typ.desc= Tptr (t, _)})] + | [(var_exp, ({desc= Tptr (t, _)} as var_typ))] when is_dyn_array + -> (* represent dynamic array as Tarray *) + (var_exp, Typ.mk ~default:var_typ (Typ.Tarray (t, None, None))) + | [(var_exp, {desc= Tptr (t, _)})] when not is_dyn_array -> (var_exp, t) | _ -> assert false @@ -2550,25 +2562,27 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s {stmt_info with Clang_ast_t.si_pointer= CAst_utils.get_fresh_pointer ()} in let res_trans_init = - if is_dyn_array && Typ.is_pointer_to_cpp_class typ then - let rec create_stmts stmt_opt size_exp_opt = - match (stmt_opt, size_exp_opt) with - | Some stmt, Some Exp.Const Const.Cint n when not (IntLit.iszero n) - -> let n_minus_1 = Some (Exp.Const (Const.Cint (IntLit.sub n IntLit.one))) in - stmt :: create_stmts stmt_opt n_minus_1 - | _ - -> [] - in - let stmts = create_stmts stmt_opt size_exp_opt in - let var_exp, typ = var_exp_typ in - let res_trans_init_list = - initListExpr_initializers_trans trans_state_init var_exp 0 stmts typ is_dyn_array - stmt_info - in - CTrans_utils.collect_res_trans context.procdesc res_trans_init_list - else init_expr_trans trans_state_init var_exp_typ init_stmt_info stmt_opt + match stmt_opt with + | Some InitListExpr _ + -> [init_expr_trans trans_state_init var_exp_typ init_stmt_info stmt_opt] + | _ when is_dyn_array && Typ.is_pointer_to_cpp_class typ + -> (* NOTE: this is heuristic to initialize C++ objects when the size of dynamic + array is constant, it doesn't do anything for non-const lengths, it should be translated as a loop *) + let rec create_stmts stmt_opt size_exp_opt = + match (stmt_opt, size_exp_opt) with + | Some stmt, Some Exp.Const Const.Cint n when not (IntLit.iszero n) + -> let n_minus_1 = Some (Exp.Const (Const.Cint (IntLit.sub n IntLit.one))) in + stmt :: create_stmts stmt_opt n_minus_1 + | _ + -> [] + in + let stmts = create_stmts stmt_opt size_exp_opt in + let var_exp, var_typ = var_exp_typ in + initListExpr_array_trans trans_state_init init_stmt_info stmts var_exp var_typ + | _ + -> [init_expr_trans trans_state_init var_exp_typ init_stmt_info stmt_opt] in - let all_res_trans = [res_trans_size; res_trans_new; res_trans_init] in + let all_res_trans = [res_trans_size; res_trans_new] @ res_trans_init in let nname = "CXXNewExpr" in let result_trans_to_parent = PriorityNode.compute_results_to_parent trans_state_pri sil_loc nname stmt_info all_res_trans @@ -2994,8 +3008,8 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s | CXXDefaultArgExpr (_, _, _, default_expr_info) | CXXDefaultInitExpr (_, _, _, default_expr_info) -> cxxDefaultExpr_trans trans_state default_expr_info - | ImplicitValueInitExpr (_, _, expr_info) - -> implicitValueInitExpr_trans trans_state expr_info + | ImplicitValueInitExpr (stmt_info, _, _) + -> implicitValueInitExpr_trans trans_state stmt_info | GenericSelectionExpr _ (* to be fixed when we dump the right info in the ast *) | SizeOfPackExpr _ diff --git a/infer/src/clang/cTrans_utils.ml b/infer/src/clang/cTrans_utils.ml index 7666633f7..5910a5c00 100644 --- a/infer/src/clang/cTrans_utils.ml +++ b/infer/src/clang/cTrans_utils.ml @@ -791,47 +791,6 @@ let is_dispatch_function stmt_list = let is_block_enumerate_function mei = String.equal mei.Clang_ast_t.omei_selector CFrontend_config.enumerateObjectsUsingBlock -(* This takes a variable of type struct or array and returns a list of expressions *) -(* for each of its fields (also recursively, such that each field access is of a basic type) *) -(* If the flag return_zero is true, the list will be a list of zero values, otherwise it will *) -(* be a list of LField expressions *) -let var_or_zero_in_init_list tenv e typ ~return_zero = - let rec var_or_zero_in_init_list' e typ tns = - let open CGeneral_utils in - match typ.Typ.desc with - | Tstruct tn -> ( - match Tenv.lookup tenv tn with - | Some {fields} - -> let lh_exprs = - List.filter_map fields ~f:(fun (fieldname, _, _) -> - if Typ.Fieldname.is_hidden fieldname then None - else Some (Exp.Lfield (e, fieldname, typ)) ) - in - let lh_types = List.map ~f:(fun (_, fieldtype, _) -> fieldtype) fields in - let exp_types = zip lh_exprs lh_types in - List.map ~f:(fun (e, t) -> List.concat (var_or_zero_in_init_list' e t tns)) exp_types - | None - -> assert false ) - | Tarray (arrtyp, Some n, _) - -> let size = IntLit.to_int n in - let indices = list_range 0 (size - 1) in - let index_constants = - List.map ~f:(fun i -> Exp.Const (Const.Cint (IntLit.of_int i))) indices - in - let lh_exprs = - List.map ~f:(fun index_expr -> Exp.Lindex (e, index_expr)) index_constants - in - let lh_types = replicate size arrtyp in - let exp_types = zip lh_exprs lh_types in - List.map ~f:(fun (e, t) -> List.concat (var_or_zero_in_init_list' e t tns)) exp_types - | Tint _ | Tfloat _ | Tptr _ - -> let exp = if return_zero then Sil.zero_value_of_numerical_type typ else e in - [[(exp, typ)]] - | Tfun _ | Tvoid | Tarray _ | TVar _ - -> assert false - in - List.concat (var_or_zero_in_init_list' e typ String.Set.empty) - (* (** Similar to extract_item_from_singleton but for option type *) let extract_item_from_option op warning_string = diff --git a/infer/src/clang/cTrans_utils.mli b/infer/src/clang/cTrans_utils.mli index a525cbcfb..b338fe2bf 100644 --- a/infer/src/clang/cTrans_utils.mli +++ b/infer/src/clang/cTrans_utils.mli @@ -222,5 +222,3 @@ val is_logical_negation_of_int : 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 - -val var_or_zero_in_init_list : Tenv.t -> Exp.t -> Typ.t -> return_zero:bool -> (Exp.t * Typ.t) list diff --git a/infer/tests/codetoanalyze/c/frontend/initialization/struct_initlistexpr.c.dot b/infer/tests/codetoanalyze/c/frontend/initialization/struct_initlistexpr.c.dot index 4f6eb9c40..d9946536f 100644 --- a/infer/tests/codetoanalyze/c/frontend/initialization/struct_initlistexpr.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/initialization/struct_initlistexpr.c.dot @@ -18,7 +18,7 @@ digraph iCFG { "main.fad58de7366495db4650cfefac2fcd61_2" [label="2: Exit main \n " color=yellow style=filled] -"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: DeclStmt \n n$0=_fun_foo() [line 17]\n *&p.x:int=1 [line 17]\n *&p.y:int=(n$0 + 3) [line 17]\n " shape="box"] +"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: DeclStmt \n *&p.x:int=1 [line 17]\n n$0=_fun_foo() [line 17]\n *&p.y:int=(n$0 + 3) [line 17]\n " shape="box"] "main.fad58de7366495db4650cfefac2fcd61_3" -> "main.fad58de7366495db4650cfefac2fcd61_2" ; diff --git a/infer/tests/codetoanalyze/cpp/frontend/initialization/init_list.cpp b/infer/tests/codetoanalyze/cpp/frontend/initialization/init_list.cpp new file mode 100644 index 000000000..328d9dbe4 --- /dev/null +++ b/infer/tests/codetoanalyze/cpp/frontend/initialization/init_list.cpp @@ -0,0 +1,52 @@ +/* + * 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. + */ +namespace init_list { +struct X { + int a; + int* p; +}; +struct Y { // POD struct + int z; + X x; +}; + +struct C { // non-POD struct + int z; + X x{}; + virtual void f() {} // this make C non-POD + C() = default; + C(int a, int b, const X& x) : z(a + b), x(x) {} +}; + +void zero_init_primitive() { + int i{}; + int* p{}; + float f{}; +} + +void zero_init_record() { + Y y{}; + C c{}; // this will call default constructor +} + +void record_init() { + X x{1, nullptr}; + Y y1{1, x}; // x will be copied + Y y2{1, {2, nullptr}}; + + C c{1, 2, x}; // this will call C constructor +} + +void list_init() { + int ti[4] = {1, 2}; + Y y; + Y& yref = y; + Y ty[3] = {{1, {2, nullptr}}, y, yref}; +} +} // namespace init_list diff --git a/infer/tests/codetoanalyze/cpp/frontend/initialization/init_list.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/initialization/init_list.cpp.dot new file mode 100644 index 000000000..9d3749d31 --- /dev/null +++ b/infer/tests/codetoanalyze/cpp/frontend/initialization/init_list.cpp.dot @@ -0,0 +1,164 @@ +/* @generated */ +digraph iCFG { +"zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_1" [label="1: Start init_list::zero_init_primitive\nFormals: \nLocals: f:float p:int* i:int \n DECLARE_LOCALS(&return,&f,&p,&i); [line 27]\n " color=yellow style=filled] + + + "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_1" -> "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_5" ; +"zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_2" [label="2: Exit init_list::zero_init_primitive \n " color=yellow style=filled] + + +"zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_3" [label="3: DeclStmt \n *&f:float=0.000000 [line 30]\n " shape="box"] + + + "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_3" -> "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_2" ; +"zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_4" [label="4: DeclStmt \n *&p:int*=null [line 29]\n " shape="box"] + + + "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_4" -> "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_3" ; +"zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_5" [label="5: DeclStmt \n *&i:int=0 [line 28]\n " shape="box"] + + + "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_5" -> "zero_init_primitive#init_list#_ZN9init_list19zero_init_primitiveEv.b85ffa3561c89635edd2815abd57e378_4" ; +"zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_1" [label="1: Start init_list::zero_init_record\nFormals: \nLocals: c:init_list::C y:init_list::Y \n DECLARE_LOCALS(&return,&c,&y); [line 33]\n " color=yellow style=filled] + + + "zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_1" -> "zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_4" ; +"zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_2" [label="2: Exit init_list::zero_init_record \n " color=yellow style=filled] + + +"zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_3" [label="3: DeclStmt \n _fun_init_list::C_C(&c:init_list::C*) [line 35]\n " shape="box"] + + + "zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_3" -> "zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_2" ; +"zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_4" [label="4: DeclStmt \n *&y.z:int=0 [line 34]\n *&y.x.a:int=0 [line 34]\n *&y.x.p:int*=null [line 34]\n " shape="box"] + + + "zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_4" -> "zero_init_record#init_list#_ZN9init_list16zero_init_recordEv.09310ba31a3a2e46602e1a26118731fe_3" ; +"record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_1" [label="1: Start init_list::record_init\nFormals: \nLocals: c:init_list::C y2:init_list::Y y1:init_list::Y x:init_list::X \n DECLARE_LOCALS(&return,&c,&y2,&y1,&x); [line 38]\n " color=yellow style=filled] + + + "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_1" -> "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_6" ; +"record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_2" [label="2: Exit init_list::record_init \n " color=yellow style=filled] + + +"record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_3" [label="3: DeclStmt \n _fun_init_list::C_C(&c:init_list::C*,1:int,2:int,&x:init_list::X&) [line 43]\n " shape="box"] + + + "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_3" -> "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_2" ; +"record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_4" [label="4: DeclStmt \n *&y2.z:int=1 [line 41]\n *&y2.x.a:int=2 [line 41]\n *&y2.x.p:int*=null [line 41]\n " shape="box"] + + + "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_4" -> "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_3" ; +"record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_5" [label="5: DeclStmt \n *&y1.z:int=1 [line 40]\n _fun_init_list::X_X(&y1.x:init_list::X*,&x:init_list::X&) [line 40]\n " shape="box"] + + + "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_5" -> "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_4" ; +"record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_6" [label="6: DeclStmt \n *&x.a:int=1 [line 39]\n *&x.p:int*=null [line 39]\n " shape="box"] + + + "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_6" -> "record_init#init_list#_ZN9init_list11record_initEv.01ab3feee1137be413e4f54324b076dc_5" ; +"list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_1" [label="1: Start init_list::list_init\nFormals: \nLocals: ty:init_list::Y[3*24] yref:init_list::Y& y:init_list::Y ti:int[4*4] \n DECLARE_LOCALS(&return,&ty,&yref,&y,&ti); [line 46]\n " color=yellow style=filled] + + + "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_1" -> "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_6" ; +"list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_2" [label="2: Exit init_list::list_init \n " color=yellow style=filled] + + +"list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_3" [label="3: DeclStmt \n *&ty[0].z:int=1 [line 50]\n *&ty[0].x.a:int=2 [line 50]\n *&ty[0].x.p:int*=null [line 50]\n _fun_init_list::Y_Y(&ty[1]:init_list::Y*,&y:init_list::Y&) [line 50]\n n$0=*&yref:init_list::Y& [line 50]\n _fun_init_list::Y_Y(&ty[2]:init_list::Y*,n$0:init_list::Y&) [line 50]\n " shape="box"] + + + "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_3" -> "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_2" ; +"list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_4" [label="4: DeclStmt \n *&yref:init_list::Y&=&y [line 49]\n " shape="box"] + + + "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_4" -> "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_3" ; +"list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_5" [label="5: DeclStmt \n _fun_init_list::Y_Y(&y:init_list::Y*) [line 48]\n " shape="box"] + + + "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_5" -> "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_4" ; +"list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_6" [label="6: DeclStmt \n *&ti[0]:int=1 [line 47]\n *&ti[1]:int=2 [line 47]\n " shape="box"] + + + "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_6" -> "list_init#init_list#_ZN9init_list9list_initEv.99b006dce7c65ff267ce5e090469622f_5" ; +"f#C#init_list#(_ZN9init_list1C1fEv).06c64e84e356c70868907ff8086ca5ee_1" [label="1: Start init_list::C_f\nFormals: this:init_list::C*\nLocals: \n DECLARE_LOCALS(&return); [line 22]\n " color=yellow style=filled] + + + "f#C#init_list#(_ZN9init_list1C1fEv).06c64e84e356c70868907ff8086ca5ee_1" -> "f#C#init_list#(_ZN9init_list1C1fEv).06c64e84e356c70868907ff8086ca5ee_2" ; +"f#C#init_list#(_ZN9init_list1C1fEv).06c64e84e356c70868907ff8086ca5ee_2" [label="2: Exit init_list::C_f \n " color=yellow style=filled] + + +"C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_1" [label="1: Start init_list::C_C\nFormals: this:init_list::C*\nLocals: \n DECLARE_LOCALS(&return); [line 23]\n " color=yellow style=filled] + + + "C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_1" -> "C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_3" ; +"C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_2" [label="2: Exit init_list::C_C \n " color=yellow style=filled] + + +"C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_3" [label="3: Constructor Init \n n$0=*&this:init_list::C* [line 21]\n *n$0.x.a:int=0 [line 21]\n *n$0.x.p:int*=null [line 21]\n " shape="box"] + + + "C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_3" -> "C#C#init_list#{_ZN9init_list1CC1Ev}.a982cb316a9f606e4f985649629f5f7b_2" ; +"C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_1" [label="1: Start init_list::C_C\nFormals: this:init_list::C* a:int b:int x:init_list::X const &\nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] + + + "C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_1" -> "C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_4" ; +"C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_2" [label="2: Exit init_list::C_C \n " color=yellow style=filled] + + +"C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_3" [label="3: Constructor Init \n n$0=*&this:init_list::C* [line 24]\n n$1=*&x:init_list::X const & [line 24]\n _fun_init_list::X_X(n$0.x:init_list::X*,n$1:init_list::X const &) [line 24]\n " shape="box"] + + + "C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_3" -> "C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_2" ; +"C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_4" [label="4: Constructor Init \n n$2=*&this:init_list::C* [line 24]\n n$3=*&a:int [line 24]\n n$4=*&b:int [line 24]\n *n$2.z:int=(n$3 + n$4) [line 24]\n " shape="box"] + + + "C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_4" -> "C#C#init_list#{_ZN9init_list1CC1EiiRKNS_1XE}.5006fdf84a4a36d26cb5819238a43aae_3" ; +"X#X#init_list#{_ZN9init_list1XC1Ev}.90c197e1aca71366b0e6277eb0cfe323_1" [label="1: Start init_list::X_X\nFormals: this:init_list::X*\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] + + + "X#X#init_list#{_ZN9init_list1XC1Ev}.90c197e1aca71366b0e6277eb0cfe323_1" -> "X#X#init_list#{_ZN9init_list1XC1Ev}.90c197e1aca71366b0e6277eb0cfe323_2" ; +"X#X#init_list#{_ZN9init_list1XC1Ev}.90c197e1aca71366b0e6277eb0cfe323_2" [label="2: Exit init_list::X_X \n " color=yellow style=filled] + + +"X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_1" [label="1: Start init_list::X_X\nFormals: this:init_list::X* __param_0:init_list::X const &\nLocals: \n DECLARE_LOCALS(&return); [line 10]\n " color=yellow style=filled] + + + "X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_1" -> "X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_4" ; +"X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_2" [label="2: Exit init_list::X_X \n " color=yellow style=filled] + + +"X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_3" [label="3: Constructor Init \n n$0=*&this:init_list::X* [line 10]\n n$1=*&__param_0:init_list::X const & [line 10]\n n$2=*n$1.p:int* [line 10]\n *n$0.p:int*=n$2 [line 10]\n " shape="box"] + + + "X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_3" -> "X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_2" ; +"X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_4" [label="4: Constructor Init \n n$3=*&this:init_list::X* [line 10]\n n$4=*&__param_0:init_list::X const & [line 10]\n n$5=*n$4.a:int [line 10]\n *n$3.a:int=n$5 [line 10]\n " shape="box"] + + + "X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_4" -> "X#X#init_list#{_ZN9init_list1XC1ERKS0_|constexpr}.a38ccd93d5ffe75e23ff8596fdac1c57_3" ; +"Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_1" [label="1: Start init_list::Y_Y\nFormals: this:init_list::Y*\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] + + + "Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_1" -> "Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_3" ; +"Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_2" [label="2: Exit init_list::Y_Y \n " color=yellow style=filled] + + +"Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_3" [label="3: Constructor Init \n n$0=*&this:init_list::Y* [line 14]\n _fun_init_list::X_X(n$0.x:init_list::X*) [line 14]\n " shape="box"] + + + "Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_3" -> "Y#Y#init_list#{_ZN9init_list1YC1Ev}.8d71d2d9a15cbcec2094d5d7d869076b_2" ; +"Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_1" [label="1: Start init_list::Y_Y\nFormals: this:init_list::Y* __param_0:init_list::Y const &\nLocals: \n DECLARE_LOCALS(&return); [line 14]\n " color=yellow style=filled] + + + "Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_1" -> "Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_4" ; +"Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_2" [label="2: Exit init_list::Y_Y \n " color=yellow style=filled] + + +"Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_3" [label="3: Constructor Init \n n$0=*&this:init_list::Y* [line 14]\n n$1=*&__param_0:init_list::Y const & [line 14]\n _fun_init_list::X_X(n$0.x:init_list::X*,n$1.x:init_list::X&) [line 14]\n " shape="box"] + + + "Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_3" -> "Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_2" ; +"Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_4" [label="4: Constructor Init \n n$2=*&this:init_list::Y* [line 14]\n n$3=*&__param_0:init_list::Y const & [line 14]\n n$4=*n$3.z:int [line 14]\n *n$2.z:int=n$4 [line 14]\n " shape="box"] + + + "Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_4" -> "Y#Y#init_list#{_ZN9init_list1YC1ERKS0_|constexpr}.8343a3083975a644a7b090ffc380bd40_3" ; +} diff --git a/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_array.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_array.cpp.dot index 0e2f5c4ff..9c7259ad3 100644 --- a/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_array.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_array.cpp.dot @@ -11,7 +11,7 @@ digraph iCFG { "array_of_person#_Z15array_of_personv.7c553fa3272204bd300dabdf4e138df7_3" -> "array_of_person#_Z15array_of_personv.7c553fa3272204bd300dabdf4e138df7_2" ; -"array_of_person#_Z15array_of_personv.7c553fa3272204bd300dabdf4e138df7_4" [label="4: DeclStmt \n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$3:Person*) [line 18]\n _fun_Person_Person(&arr[0]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$3:Person&) [line 18]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$2:Person*) [line 18]\n _fun_Person_Person(&arr[1]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$2:Person&) [line 18]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$1:Person*) [line 18]\n _fun_Person_Person(&arr[2]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$1:Person&) [line 18]\n " shape="box"] +"array_of_person#_Z15array_of_personv.7c553fa3272204bd300dabdf4e138df7_4" [label="4: DeclStmt \n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$1:Person*) [line 18]\n _fun_Person_Person(&arr[0]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$1:Person&) [line 18]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$2:Person*) [line 18]\n _fun_Person_Person(&arr[1]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$2:Person&) [line 18]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$3:Person*) [line 18]\n _fun_Person_Person(&arr[2]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$3:Person&) [line 18]\n " shape="box"] "array_of_person#_Z15array_of_personv.7c553fa3272204bd300dabdf4e138df7_4" -> "array_of_person#_Z15array_of_personv.7c553fa3272204bd300dabdf4e138df7_3" ; @@ -26,7 +26,7 @@ digraph iCFG { "matrix_of_person#_Z16matrix_of_personv.39f4dcf0df55c7259a99fabe8ccde35d_3" -> "matrix_of_person#_Z16matrix_of_personv.39f4dcf0df55c7259a99fabe8ccde35d_2" ; -"matrix_of_person#_Z16matrix_of_personv.39f4dcf0df55c7259a99fabe8ccde35d_4" [label="4: DeclStmt \n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$4:Person*) [line 23]\n _fun_Person_Person(&arr[0][0]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$4:Person&) [line 23]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$3:Person*) [line 23]\n _fun_Person_Person(&arr[0][1]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$3:Person&) [line 23]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$2:Person*) [line 23]\n _fun_Person_Person(&arr[1][0]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$2:Person&) [line 23]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$1:Person*) [line 23]\n _fun_Person_Person(&arr[1][1]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$1:Person&) [line 23]\n " shape="box"] +"matrix_of_person#_Z16matrix_of_personv.39f4dcf0df55c7259a99fabe8ccde35d_4" [label="4: DeclStmt \n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$1:Person*) [line 23]\n _fun_Person_Person(&arr[0][0]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$1:Person&) [line 23]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$2:Person*) [line 23]\n _fun_Person_Person(&arr[0][1]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$2:Person&) [line 23]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$3:Person*) [line 23]\n _fun_Person_Person(&arr[1][0]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$3:Person&) [line 23]\n _fun_Person_Person(&0$?%__sil_tmpSIL_materialize_temp__n$4:Person*) [line 23]\n _fun_Person_Person(&arr[1][1]:Person*,&0$?%__sil_tmpSIL_materialize_temp__n$4:Person&) [line 23]\n " shape="box"] "matrix_of_person#_Z16matrix_of_personv.39f4dcf0df55c7259a99fabe8ccde35d_4" -> "matrix_of_person#_Z16matrix_of_personv.39f4dcf0df55c7259a99fabe8ccde35d_3" ; @@ -56,7 +56,7 @@ digraph iCFG { "initialization_mixed_styles_not_handled_correctly#_Z49initialization_mixed_styles_not_handled_correc.e1de50291cecd2ac4e0ba29b88e060a6_3" -> "initialization_mixed_styles_not_handled_correctly#_Z49initialization_mixed_styles_not_handled_correc.e1de50291cecd2ac4e0ba29b88e060a6_2" ; -"initialization_mixed_styles_not_handled_correctly#_Z49initialization_mixed_styles_not_handled_correc.e1de50291cecd2ac4e0ba29b88e060a6_4" [label="4: DeclStmt \n _fun_Z_Z(&z[1]:Z*,&old:Z&) [line 41]\n " shape="box"] +"initialization_mixed_styles_not_handled_correctly#_Z49initialization_mixed_styles_not_handled_correc.e1de50291cecd2ac4e0ba29b88e060a6_4" [label="4: DeclStmt \n *&z[0].a:int=1 [line 41]\n *&z[0].b:int=2 [line 41]\n _fun_Z_Z(&z[1]:Z*,&old:Z&) [line 41]\n " shape="box"] "initialization_mixed_styles_not_handled_correctly#_Z49initialization_mixed_styles_not_handled_correc.e1de50291cecd2ac4e0ba29b88e060a6_4" -> "initialization_mixed_styles_not_handled_correctly#_Z49initialization_mixed_styles_not_handled_correc.e1de50291cecd2ac4e0ba29b88e060a6_3" ; diff --git a/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot index c6833cc5c..f890dd06f 100644 --- a/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/constructors/constructor_new.cpp.dot @@ -303,7 +303,7 @@ digraph iCFG { "array_of_person_with_constant_size#constructor_new#_ZN15constructor_new34array_of_person_with_consta.216f1e02a6e135eec1b8bbd6115403a9_2" [label="2: Exit constructor_new::array_of_person_with_constant_size \n " color=yellow style=filled] -"array_of_person_with_constant_size#constructor_new#_ZN15constructor_new34array_of_person_with_consta.216f1e02a6e135eec1b8bbd6115403a9_3" [label="3: DeclStmt \n n$0=_fun___new_array((sizeof(t=constructor_new::Person) * 10):unsigned long) [line 95]\n _fun_constructor_new::Person_Person(n$0[0]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[1]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[2]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[3]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[4]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[5]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[6]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[7]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[8]:constructor_new::Person*) [line 95]\n _fun_constructor_new::Person_Person(n$0[9]:constructor_new::Person*) [line 95]\n *&tarray:constructor_new::Person*=n$0 [line 95]\n " shape="box"] +"array_of_person_with_constant_size#constructor_new#_ZN15constructor_new34array_of_person_with_consta.216f1e02a6e135eec1b8bbd6115403a9_3" [label="3: DeclStmt \n n$0=_fun___new_array((sizeof(t=constructor_new::Person) * 10):unsigned long) [line 95]\n _fun_constructor_new::Person_Person(n$0[0]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[1]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[2]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[3]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[4]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[5]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[6]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[7]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[8]:constructor_new::Person[_*_](*)) [line 95]\n _fun_constructor_new::Person_Person(n$0[9]:constructor_new::Person[_*_](*)) [line 95]\n *&tarray:constructor_new::Person*=n$0 [line 95]\n " shape="box"] "array_of_person_with_constant_size#constructor_new#_ZN15constructor_new34array_of_person_with_consta.216f1e02a6e135eec1b8bbd6115403a9_3" -> "array_of_person_with_constant_size#constructor_new#_ZN15constructor_new34array_of_person_with_consta.216f1e02a6e135eec1b8bbd6115403a9_2" ; @@ -314,7 +314,7 @@ digraph iCFG { "matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_2" [label="2: Exit constructor_new::matrix_of_person \n " color=yellow style=filled] -"matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&tarray:constructor_new::Person** [line 100]\n n$1=_fun___new_array((sizeof(t=constructor_new::Person) * 10):unsigned long) [line 100]\n _fun_constructor_new::Person_Person(n$1[0]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[1]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[2]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[3]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[4]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[5]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[6]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[7]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[8]:constructor_new::Person*) [line 100]\n _fun_constructor_new::Person_Person(n$1[9]:constructor_new::Person*) [line 100]\n *n$0[0]:constructor_new::Person*=n$1 [line 100]\n " shape="box"] +"matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&tarray:constructor_new::Person** [line 100]\n n$1=_fun___new_array((sizeof(t=constructor_new::Person) * 10):unsigned long) [line 100]\n _fun_constructor_new::Person_Person(n$1[0]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[1]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[2]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[3]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[4]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[5]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[6]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[7]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[8]:constructor_new::Person[_*_](*)) [line 100]\n _fun_constructor_new::Person_Person(n$1[9]:constructor_new::Person[_*_](*)) [line 100]\n *n$0[0]:constructor_new::Person*=n$1 [line 100]\n " shape="box"] "matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_3" -> "matrix_of_person#constructor_new#_ZN15constructor_new16matrix_of_personEv.6eca49c294523e3080fbda7d175061b6_2" ; diff --git a/infer/tests/codetoanalyze/cpp/shared/constructors/std_init_list.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/constructors/std_init_list.cpp.dot index fd03e361a..cb745d0af 100644 --- a/infer/tests/codetoanalyze/cpp/shared/constructors/std_init_list.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/constructors/std_init_list.cpp.dot @@ -7,7 +7,7 @@ digraph iCFG { "main.fad58de7366495db4650cfefac2fcd61_2" [label="2: Exit main \n " color=yellow style=filled] -"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: DeclStmt \n *&0$?%__sil_tmpSIL_materialize_temp__n$0[0]:int const =1 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[1]:int const =2 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[2]:int const =3 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[3]:int const =4 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[4]:int const =5 [line 24]\n n$1=_fun___infer_skip_function(&0$?%__sil_tmpSIL_materialize_temp__n$0:int const [5*4] const ) [line 24]\n _fun_X_X(&x:X*,n$1:std::initializer_list) [line 24]\n " shape="box"] +"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: DeclStmt \n *&0$?%__sil_tmpSIL_materialize_temp__n$0[0]:int=1 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[1]:int=2 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[2]:int=3 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[3]:int=4 [line 24]\n *&0$?%__sil_tmpSIL_materialize_temp__n$0[4]:int=5 [line 24]\n n$1=_fun___infer_skip_function(&0$?%__sil_tmpSIL_materialize_temp__n$0:int const [5*4] const ) [line 24]\n _fun_X_X(&x:X*,n$1:std::initializer_list) [line 24]\n " shape="box"] "main.fad58de7366495db4650cfefac2fcd61_3" -> "main.fad58de7366495db4650cfefac2fcd61_2" ; diff --git a/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m.dot b/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m.dot index 45543b94d..5f4fd01c5 100644 --- a/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m.dot +++ b/infer/tests/codetoanalyze/objc/frontend/vardecl/initlist.m.dot @@ -18,7 +18,7 @@ digraph iCFG { "test.098f6bcd4621d373cade4e832627b4f6_2" [label="2: Exit test \n " color=yellow style=filled] -"test.098f6bcd4621d373cade4e832627b4f6_3" [label="3: DeclStmt \n n$2=*&c1:C* [line 25]\n n$3=_fun_NSObject_init(n$2:C*) virtual [line 25]\n n$1=*&c1:C* [line 25]\n n$0=*&c2:C* [line 25]\n *&a[0]:C*=n$3 [line 25]\n *&a[1]:C*=n$1 [line 25]\n *&a[2]:C*=n$0 [line 25]\n " shape="box"] +"test.098f6bcd4621d373cade4e832627b4f6_3" [label="3: DeclStmt \n n$0=*&c1:C* [line 25]\n n$1=_fun_NSObject_init(n$0:C*) virtual [line 25]\n *&a[0]:C*=n$1 [line 25]\n n$2=*&c1:C* [line 25]\n _fun___objc_retain(n$2:C*) [line 25]\n *&a[1]:C*=n$2 [line 25]\n n$3=*&c2:C* [line 25]\n _fun___objc_retain(n$3:C*) [line 25]\n *&a[2]:C*=n$3 [line 25]\n " shape="box"] "test.098f6bcd4621d373cade4e832627b4f6_3" -> "test.098f6bcd4621d373cade4e832627b4f6_2" ;