diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index 1429c978a..f7dad423e 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -1587,13 +1587,6 @@ struct let var_exp, var_typ = extract_exp_from_list var_res_trans.exps "WARNING: init_expr_trans expects one variable expression" in let trans_state_pri = PriorityNode.try_claim_priority_node trans_state var_stmt_info in - let next_node = - if PriorityNode.own_priority_node trans_state_pri.priority var_stmt_info then ( - let node_kind = Cfg.Node.Stmt_node "DeclStmt" in - let node = create_node node_kind [] [] sil_loc context in - Cfg.Node.set_succs_exn node trans_state.succ_nodes []; - [node] - ) else trans_state.succ_nodes in let line_number = CLocation.get_line stmt_info pln in (* if ie is a block the translation need to be done with the block special cases by exec_with_block_priority*) let res_trans_ie = @@ -1620,10 +1613,11 @@ struct let ids = var_res_trans.ids @ res_trans_ie.ids @ ids_assign in let instrs = var_res_trans.instrs @ res_trans_ie.instrs @ instrs_assign in if PriorityNode.own_priority_node trans_state_pri.priority var_stmt_info then ( - let node = IList.hd next_node in - Cfg.Node.append_instrs_temps node instrs ids; + let node_kind = Cfg.Node.Stmt_node "DeclStmt" in + let node = create_node node_kind ids instrs sil_loc context in + Cfg.Node.set_succs_exn node trans_state.succ_nodes []; IList.iter (fun n -> Cfg.Node.set_succs_exn n [node] []) leaf_nodes; - let root_nodes = if (IList.length root_nodes) = 0 then next_node else root_nodes in + let root_nodes = if (IList.length root_nodes) = 0 then [node] else root_nodes in { root_nodes = root_nodes; leaf_nodes = []; @@ -1820,8 +1814,10 @@ struct let sil_loc = CLocation.get_sil_location stmt_info pln context in let line_number = CLocation.get_line stmt_info pln in let trans_state_pri = PriorityNode.try_claim_priority_node trans_state stmt_info in - let ret_node = create_node (Cfg.Node.Stmt_node "Return Stmt") [] [] sil_loc context in - Cfg.Node.set_succs_exn ret_node [(Cfg.Procdesc.get_exit_node context.CContext.procdesc)] []; + let mk_ret_node ids instrs = + let ret_node = create_node (Cfg.Node.Stmt_node "Return Stmt") ids instrs sil_loc context in + Cfg.Node.set_succs_exn ret_node [(Cfg.Procdesc.get_exit_node context.CContext.procdesc)] []; + ret_node in let trans_result = (match stmt_list with | [stmt] -> (* return exp; *) let trans_state' = { trans_state_pri with @@ -1836,12 +1832,13 @@ struct let autorelease_ids, autorelease_instrs = add_autorelease_call context sil_expr ret_type sil_loc in let instrs = res_trans_stmt.instrs @ [ret_instr] @ autorelease_instrs in let ids = res_trans_stmt.ids@autorelease_ids in - Cfg.Node.append_instrs_temps ret_node instrs ids; + let ret_node = mk_ret_node ids instrs in IList.iter (fun n -> Cfg.Node.set_succs_exn n [ret_node] []) res_trans_stmt.leaf_nodes; let root_nodes_to_parent = if IList.length res_trans_stmt.root_nodes >0 then res_trans_stmt.root_nodes else [ret_node] in { empty_res_trans with root_nodes = root_nodes_to_parent; leaf_nodes = [ret_node]} | [] -> (* return; *) + let ret_node = mk_ret_node [] [] in { empty_res_trans with root_nodes = [ret_node]; leaf_nodes = [ret_node]} | _ -> Printing.log_out "\nWARNING: Missing translation of Return Expression. Return Statement ignored. Need fixing!\n"; diff --git a/infer/tests/codetoanalyze/c/frontend/conditional_operator/binary_operator.c.dot b/infer/tests/codetoanalyze/c/frontend/conditional_operator/binary_operator.c.dot index 3b75a2730..4e61eb1bd 100644 --- a/infer/tests/codetoanalyze/c/frontend/conditional_operator/binary_operator.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/conditional_operator/binary_operator.c.dot @@ -52,8 +52,8 @@ digraph iCFG { 36 [label="36: BinaryOperatorStmt: Assign \n n$14=*&SIL_temp_conditional___26:int [line 19]\n NULLIFY(&SIL_temp_conditional___26,true); [line 19]\n n$17=*&SIL_temp_conditional___31:int [line 19]\n NULLIFY(&SIL_temp_conditional___31,true); [line 19]\n *&x3:int =(n$14 + n$17) [line 19]\n REMOVE_TEMPS(n$14,n$17); [line 19]\n NULLIFY(&x3,false); [line 19]\n " shape="box"] + 36 -> 21 ; 36 -> 22 ; - 36 -> 23 ; 35 [label="35: ConditinalStmt Branch \n n$16=*&z:int [line 19]\n DECLARE_LOCALS(&SIL_temp_conditional___31); [line 19]\n *&SIL_temp_conditional___31:int =n$16 [line 19]\n REMOVE_TEMPS(n$16); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] @@ -95,101 +95,101 @@ digraph iCFG { 26 -> 32 ; 26 -> 33 ; -25 [label="25: ConditinalStmt Branch \n n$10=*&z:int [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___21); [line 23]\n *&SIL_temp_conditional___21:int =n$10 [line 23]\n REMOVE_TEMPS(n$10); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] +25 [label="25: DeclStmt \n n$11=*&SIL_temp_conditional___20:int [line 23]\n NULLIFY(&SIL_temp_conditional___20,true); [line 23]\n *&y1:int =(n$11 + 77) [line 23]\n REMOVE_TEMPS(n$11); [line 23]\n NULLIFY(&y1,false); [line 23]\n " shape="box"] - 25 -> 21 ; -24 [label="24: ConditinalStmt Branch \n n$9=*&z:int [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___21); [line 23]\n *&SIL_temp_conditional___21:int =n$9 [line 23]\n REMOVE_TEMPS(n$9); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] + 25 -> 15 ; + 25 -> 16 ; +24 [label="24: ConditinalStmt Branch \n n$10=*&z:int [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___20); [line 23]\n *&SIL_temp_conditional___20:int =n$10 [line 23]\n REMOVE_TEMPS(n$10); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] - 24 -> 21 ; -23 [label="23: Prune (false branch) \n PRUNE((1 == 0), false); [line 23]\n " shape="invhouse"] + 24 -> 20 ; +23 [label="23: ConditinalStmt Branch \n n$9=*&z:int [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___20); [line 23]\n *&SIL_temp_conditional___20:int =n$9 [line 23]\n REMOVE_TEMPS(n$9); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] - 23 -> 25 ; -22 [label="22: Prune (true branch) \n PRUNE((1 != 0), true); [line 23]\n " shape="invhouse"] + 23 -> 20 ; +22 [label="22: Prune (false branch) \n PRUNE((1 == 0), false); [line 23]\n " shape="invhouse"] 22 -> 24 ; -21 [label="21: + \n " ] +21 [label="21: Prune (true branch) \n PRUNE((1 != 0), true); [line 23]\n " shape="invhouse"] - 21 -> 20 ; -20 [label="20: DeclStmt \n n$11=*&SIL_temp_conditional___21:int [line 23]\n NULLIFY(&SIL_temp_conditional___21,true); [line 23]\n *&y1:int =(n$11 + 77) [line 23]\n REMOVE_TEMPS(n$11); [line 23]\n NULLIFY(&y1,false); [line 23]\n " shape="box"] + 21 -> 23 ; +20 [label="20: + \n " ] - 20 -> 16 ; - 20 -> 17 ; -19 [label="19: ConditinalStmt Branch \n n$7=*&z:int [line 25]\n DECLARE_LOCALS(&SIL_temp_conditional___15); [line 25]\n *&SIL_temp_conditional___15:int =n$7 [line 25]\n REMOVE_TEMPS(n$7); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] + 20 -> 25 ; +19 [label="19: DeclStmt \n n$8=*&SIL_temp_conditional___14:int [line 25]\n NULLIFY(&SIL_temp_conditional___14,true); [line 25]\n *&y2:int =(77 + n$8) [line 25]\n REMOVE_TEMPS(n$8); [line 25]\n NULLIFY(&y2,false); [line 25]\n " shape="box"] - 19 -> 15 ; -18 [label="18: ConditinalStmt Branch \n n$6=*&z:int [line 25]\n DECLARE_LOCALS(&SIL_temp_conditional___15); [line 25]\n *&SIL_temp_conditional___15:int =n$6 [line 25]\n REMOVE_TEMPS(n$6); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] + 19 -> 4 ; + 19 -> 5 ; +18 [label="18: ConditinalStmt Branch \n n$7=*&z:int [line 25]\n DECLARE_LOCALS(&SIL_temp_conditional___14); [line 25]\n *&SIL_temp_conditional___14:int =n$7 [line 25]\n REMOVE_TEMPS(n$7); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] - 18 -> 15 ; -17 [label="17: Prune (false branch) \n PRUNE((1 == 0), false); [line 25]\n " shape="invhouse"] + 18 -> 14 ; +17 [label="17: ConditinalStmt Branch \n n$6=*&z:int [line 25]\n DECLARE_LOCALS(&SIL_temp_conditional___14); [line 25]\n *&SIL_temp_conditional___14:int =n$6 [line 25]\n REMOVE_TEMPS(n$6); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] - 17 -> 19 ; -16 [label="16: Prune (true branch) \n PRUNE((1 != 0), true); [line 25]\n " shape="invhouse"] + 17 -> 14 ; +16 [label="16: Prune (false branch) \n PRUNE((1 == 0), false); [line 25]\n " shape="invhouse"] 16 -> 18 ; -15 [label="15: + \n " ] +15 [label="15: Prune (true branch) \n PRUNE((1 != 0), true); [line 25]\n " shape="invhouse"] - 15 -> 14 ; -14 [label="14: DeclStmt \n n$8=*&SIL_temp_conditional___15:int [line 25]\n NULLIFY(&SIL_temp_conditional___15,true); [line 25]\n *&y2:int =(77 + n$8) [line 25]\n REMOVE_TEMPS(n$8); [line 25]\n NULLIFY(&y2,false); [line 25]\n " shape="box"] + 15 -> 17 ; +14 [label="14: + \n " ] - 14 -> 5 ; - 14 -> 6 ; -13 [label="13: ConditinalStmt Branch \n n$4=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___9); [line 27]\n *&SIL_temp_conditional___9:int =n$4 [line 27]\n REMOVE_TEMPS(n$4); [line 27]\n NULLIFY(&z,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] + 14 -> 19 ; +13 [label="13: DeclStmt \n n$2=*&SIL_temp_conditional___3:int [line 27]\n NULLIFY(&SIL_temp_conditional___3,true); [line 27]\n n$5=*&SIL_temp_conditional___8:int [line 27]\n NULLIFY(&SIL_temp_conditional___8,true); [line 27]\n *&y3:int =(n$2 + n$5) [line 27]\n REMOVE_TEMPS(n$2,n$5); [line 27]\n NULLIFY(&y3,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 13 -> 9 ; -12 [label="12: ConditinalStmt Branch \n n$3=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___9); [line 27]\n *&SIL_temp_conditional___9:int =n$3 [line 27]\n REMOVE_TEMPS(n$3); [line 27]\n NULLIFY(&z,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] + 13 -> 2 ; +12 [label="12: ConditinalStmt Branch \n n$4=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___8); [line 27]\n *&SIL_temp_conditional___8:int =n$4 [line 27]\n REMOVE_TEMPS(n$4); [line 27]\n NULLIFY(&z,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 12 -> 9 ; -11 [label="11: Prune (false branch) \n PRUNE((1 == 0), false); [line 27]\n " shape="invhouse"] + 12 -> 8 ; +11 [label="11: ConditinalStmt Branch \n n$3=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___8); [line 27]\n *&SIL_temp_conditional___8:int =n$3 [line 27]\n REMOVE_TEMPS(n$3); [line 27]\n NULLIFY(&z,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 11 -> 13 ; -10 [label="10: Prune (true branch) \n PRUNE((1 != 0), true); [line 27]\n " shape="invhouse"] + 11 -> 8 ; +10 [label="10: Prune (false branch) \n PRUNE((1 == 0), false); [line 27]\n " shape="invhouse"] 10 -> 12 ; -9 [label="9: + \n " ] +9 [label="9: Prune (true branch) \n PRUNE((1 != 0), true); [line 27]\n " shape="invhouse"] - 9 -> 3 ; -8 [label="8: ConditinalStmt Branch \n n$1=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___4); [line 27]\n *&SIL_temp_conditional___4:int =n$1 [line 27]\n REMOVE_TEMPS(n$1); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] + 9 -> 11 ; +8 [label="8: + \n " ] - 8 -> 4 ; -7 [label="7: ConditinalStmt Branch \n n$0=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___4); [line 27]\n *&SIL_temp_conditional___4:int =n$0 [line 27]\n REMOVE_TEMPS(n$0); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] + 8 -> 13 ; +7 [label="7: ConditinalStmt Branch \n n$1=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___3); [line 27]\n *&SIL_temp_conditional___3:int =n$1 [line 27]\n REMOVE_TEMPS(n$1); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 7 -> 4 ; -6 [label="6: Prune (false branch) \n PRUNE((1 == 0), false); [line 27]\n " shape="invhouse"] + 7 -> 3 ; +6 [label="6: ConditinalStmt Branch \n n$0=*&z:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___3); [line 27]\n *&SIL_temp_conditional___3:int =n$0 [line 27]\n REMOVE_TEMPS(n$0); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 6 -> 8 ; -5 [label="5: Prune (true branch) \n PRUNE((1 != 0), true); [line 27]\n " shape="invhouse"] + 6 -> 3 ; +5 [label="5: Prune (false branch) \n PRUNE((1 == 0), false); [line 27]\n " shape="invhouse"] 5 -> 7 ; -4 [label="4: + \n " ] +4 [label="4: Prune (true branch) \n PRUNE((1 != 0), true); [line 27]\n " shape="invhouse"] - 4 -> 10 ; - 4 -> 11 ; -3 [label="3: DeclStmt \n n$2=*&SIL_temp_conditional___4:int [line 27]\n NULLIFY(&SIL_temp_conditional___4,true); [line 27]\n n$5=*&SIL_temp_conditional___9:int [line 27]\n NULLIFY(&SIL_temp_conditional___9,true); [line 27]\n *&y3:int =(n$2 + n$5) [line 27]\n REMOVE_TEMPS(n$2,n$5); [line 27]\n NULLIFY(&y3,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] + 4 -> 6 ; +3 [label="3: + \n " ] - 3 -> 2 ; + 3 -> 9 ; + 3 -> 10 ; 2 [label="2: Exit binop_with_side_effects \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/c/frontend/conditional_operator/cond2.c.dot b/infer/tests/codetoanalyze/c/frontend/conditional_operator/cond2.c.dot index 9573c6473..36d39eb51 100644 --- a/infer/tests/codetoanalyze/c/frontend/conditional_operator/cond2.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/conditional_operator/cond2.c.dot @@ -2,8 +2,8 @@ digraph iCFG { 57 [label="57: BinaryOperatorStmt: Assign \n n$6=*&SIL_temp_conditional___51:int [line 23]\n NULLIFY(&SIL_temp_conditional___51,true); [line 23]\n *&y:int =n$6 [line 23]\n REMOVE_TEMPS(n$6); [line 23]\n NULLIFY(&y,false); [line 23]\n " shape="box"] + 57 -> 41 ; 57 -> 42 ; - 57 -> 43 ; 56 [label="56: UnaryOperator \n n$5=*&x:int [line 23]\n *&x:int =(n$5 - 1) [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___51); [line 23]\n *&SIL_temp_conditional___51:int =n$5 [line 23]\n REMOVE_TEMPS(n$5); [line 23]\n NULLIFY(&x,false); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] @@ -29,55 +29,55 @@ digraph iCFG { 51 -> 57 ; -50 [label="50: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___40); [line 24]\n *&SIL_temp_conditional___40:int =0 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +50 [label="50: Return Stmt \n n$2=*&SIL_temp_conditional___39:int [line 24]\n NULLIFY(&SIL_temp_conditional___39,true); [line 24]\n *&return:int =(0 + n$2) [line 24]\n REMOVE_TEMPS(n$2); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 50 -> 40 ; -49 [label="49: BinaryOperatorStmt: Assign \n *&x:int =1 [line 24]\n n$1=*&x:int [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___40); [line 24]\n *&SIL_temp_conditional___40:int =n$1 [line 24]\n REMOVE_TEMPS(n$1); [line 24]\n NULLIFY(&x,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] + 50 -> 38 ; +49 [label="49: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___39); [line 24]\n *&SIL_temp_conditional___39:int =0 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 49 -> 40 ; -48 [label="48: Prune (false branch) \n PRUNE(((n$0 > 1) == 0), false); [line 24]\n REMOVE_TEMPS(n$0); [line 24]\n " shape="invhouse"] + 49 -> 39 ; +48 [label="48: BinaryOperatorStmt: Assign \n *&x:int =1 [line 24]\n n$1=*&x:int [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___39); [line 24]\n *&SIL_temp_conditional___39:int =n$1 [line 24]\n REMOVE_TEMPS(n$1); [line 24]\n NULLIFY(&x,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 48 -> 50 ; -47 [label="47: Prune (true branch) \n PRUNE(((n$0 > 1) != 0), true); [line 24]\n REMOVE_TEMPS(n$0); [line 24]\n " shape="invhouse"] + 48 -> 39 ; +47 [label="47: Prune (false branch) \n PRUNE(((n$0 > 1) == 0), false); [line 24]\n REMOVE_TEMPS(n$0); [line 24]\n " shape="invhouse"] 47 -> 49 ; -46 [label="46: BinaryOperatorStmt: GT \n n$0=*&SIL_temp_conditional___41:int [line 24]\n NULLIFY(&SIL_temp_conditional___41,true); [line 24]\n " shape="box"] +46 [label="46: Prune (true branch) \n PRUNE(((n$0 > 1) != 0), true); [line 24]\n REMOVE_TEMPS(n$0); [line 24]\n " shape="invhouse"] - 46 -> 47 ; 46 -> 48 ; -45 [label="45: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___41); [line 24]\n *&SIL_temp_conditional___41:int =2 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +45 [label="45: BinaryOperatorStmt: GT \n n$0=*&SIL_temp_conditional___40:int [line 24]\n NULLIFY(&SIL_temp_conditional___40,true); [line 24]\n " shape="box"] - 45 -> 41 ; -44 [label="44: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___41); [line 24]\n *&SIL_temp_conditional___41:int =1 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] + 45 -> 46 ; + 45 -> 47 ; +44 [label="44: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___40); [line 24]\n *&SIL_temp_conditional___40:int =2 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 44 -> 41 ; -43 [label="43: Prune (false branch) \n PRUNE(((3 > 4) == 0), false); [line 24]\n " shape="invhouse"] + 44 -> 40 ; +43 [label="43: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___40); [line 24]\n *&SIL_temp_conditional___40:int =1 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 43 -> 45 ; -42 [label="42: Prune (true branch) \n PRUNE(((3 > 4) != 0), true); [line 24]\n " shape="invhouse"] + 43 -> 40 ; +42 [label="42: Prune (false branch) \n PRUNE(((3 > 4) == 0), false); [line 24]\n " shape="invhouse"] 42 -> 44 ; -41 [label="41: + \n " ] +41 [label="41: Prune (true branch) \n PRUNE(((3 > 4) != 0), true); [line 24]\n " shape="invhouse"] - 41 -> 46 ; + 41 -> 43 ; 40 [label="40: + \n " ] - 40 -> 39 ; -39 [label="39: Return Stmt \n n$2=*&SIL_temp_conditional___40:int [line 24]\n NULLIFY(&SIL_temp_conditional___40,true); [line 24]\n *&return:int =(0 + n$2) [line 24]\n REMOVE_TEMPS(n$2); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] + 40 -> 45 ; +39 [label="39: + \n " ] - 39 -> 38 ; + 39 -> 50 ; 38 [label="38: Exit bar \n " color=yellow style=filled] @@ -122,51 +122,51 @@ digraph iCFG { 28 [label="28: DeclStmt \n *&y:int =19 [line 14]\n " shape="box"] + 28 -> 20 ; 28 -> 21 ; - 28 -> 22 ; -27 [label="27: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___20); [line 15]\n *&SIL_temp_conditional___20:int =2 [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"] +27 [label="27: DeclStmt \n n$6=*&SIL_temp_conditional___19:int [line 15]\n NULLIFY(&SIL_temp_conditional___19,true); [line 15]\n *&n:int =n$6 [line 15]\n REMOVE_TEMPS(n$6); [line 15]\n NULLIFY(&n,false); [line 15]\n " shape="box"] - 27 -> 20 ; -26 [label="26: ConditinalStmt Branch \n NULLIFY(&x,false); [line 15]\n NULLIFY(&y,false); [line 15]\n DECLARE_LOCALS(&SIL_temp_conditional___20); [line 15]\n *&SIL_temp_conditional___20:int =1 [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"] + 27 -> 10 ; + 27 -> 11 ; +26 [label="26: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___19); [line 15]\n *&SIL_temp_conditional___19:int =2 [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"] - 26 -> 20 ; -25 [label="25: Prune (false branch) \n PRUNE(((7 < (n$4 - n$5)) == 0), false); [line 15]\n REMOVE_TEMPS(n$4,n$5); [line 15]\n " shape="invhouse"] + 26 -> 19 ; +25 [label="25: ConditinalStmt Branch \n NULLIFY(&x,false); [line 15]\n NULLIFY(&y,false); [line 15]\n DECLARE_LOCALS(&SIL_temp_conditional___19); [line 15]\n *&SIL_temp_conditional___19:int =1 [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"] - 25 -> 27 ; -24 [label="24: Prune (true branch) \n PRUNE(((7 < (n$4 - n$5)) != 0), true); [line 15]\n REMOVE_TEMPS(n$4,n$5); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="invhouse"] + 25 -> 19 ; +24 [label="24: Prune (false branch) \n PRUNE(((7 < (n$4 - n$5)) == 0), false); [line 15]\n REMOVE_TEMPS(n$4,n$5); [line 15]\n " shape="invhouse"] 24 -> 26 ; -23 [label="23: BinaryOperatorStmt: LT \n n$4=*&x:int [line 15]\n *&x:int =(n$4 + 1) [line 15]\n n$5=*&y:int [line 15]\n NULLIFY(&x,false); [line 15]\n NULLIFY(&y,false); [line 15]\n " shape="box"] +23 [label="23: Prune (true branch) \n PRUNE(((7 < (n$4 - n$5)) != 0), true); [line 15]\n REMOVE_TEMPS(n$4,n$5); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="invhouse"] - 23 -> 24 ; 23 -> 25 ; -22 [label="22: Prune (false branch) \n PRUNE(((3 < 4) == 0), false); [line 15]\n " shape="invhouse"] +22 [label="22: BinaryOperatorStmt: LT \n n$4=*&x:int [line 15]\n *&x:int =(n$4 + 1) [line 15]\n n$5=*&y:int [line 15]\n NULLIFY(&x,false); [line 15]\n NULLIFY(&y,false); [line 15]\n " shape="box"] 22 -> 23 ; -21 [label="21: Prune (true branch) \n PRUNE(((3 < 4) != 0), true); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="invhouse"] + 22 -> 24 ; +21 [label="21: Prune (false branch) \n PRUNE(((3 < 4) == 0), false); [line 15]\n " shape="invhouse"] - 21 -> 26 ; -20 [label="20: + \n " ] + 21 -> 22 ; +20 [label="20: Prune (true branch) \n PRUNE(((3 < 4) != 0), true); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="invhouse"] - 20 -> 19 ; -19 [label="19: DeclStmt \n n$6=*&SIL_temp_conditional___20:int [line 15]\n NULLIFY(&SIL_temp_conditional___20,true); [line 15]\n *&n:int =n$6 [line 15]\n REMOVE_TEMPS(n$6); [line 15]\n NULLIFY(&n,false); [line 15]\n " shape="box"] + 20 -> 25 ; +19 [label="19: + \n " ] - 19 -> 10 ; - 19 -> 11 ; + 19 -> 27 ; 18 [label="18: BinaryOperatorStmt: Assign \n n$3=*&SIL_temp_conditional___9:int [line 16]\n NULLIFY(&SIL_temp_conditional___9,true); [line 16]\n *&n:int =n$3 [line 16]\n REMOVE_TEMPS(n$3); [line 16]\n NULLIFY(&n,false); [line 16]\n " shape="box"] + 18 -> 4 ; 18 -> 5 ; - 18 -> 6 ; 17 [label="17: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___13); [line 16]\n *&SIL_temp_conditional___13:int =2 [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] @@ -204,30 +204,30 @@ digraph iCFG { 9 -> 18 ; -8 [label="8: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___4); [line 17]\n *&SIL_temp_conditional___4:int =0 [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] +8 [label="8: Return Stmt \n n$0=*&SIL_temp_conditional___3:int [line 17]\n NULLIFY(&SIL_temp_conditional___3,true); [line 17]\n *&return:int =(0 + n$0) [line 17]\n REMOVE_TEMPS(n$0); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] - 8 -> 4 ; -7 [label="7: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___4); [line 17]\n *&SIL_temp_conditional___4:int =1 [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] + 8 -> 2 ; +7 [label="7: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___3); [line 17]\n *&SIL_temp_conditional___3:int =0 [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] - 7 -> 4 ; -6 [label="6: Prune (false branch) \n PRUNE(((7 > 9) == 0), false); [line 17]\n " shape="invhouse"] + 7 -> 3 ; +6 [label="6: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___3); [line 17]\n *&SIL_temp_conditional___3:int =1 [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] - 6 -> 8 ; -5 [label="5: Prune (true branch) \n PRUNE(((7 > 9) != 0), true); [line 17]\n " shape="invhouse"] + 6 -> 3 ; +5 [label="5: Prune (false branch) \n PRUNE(((7 > 9) == 0), false); [line 17]\n " shape="invhouse"] 5 -> 7 ; -4 [label="4: + \n " ] +4 [label="4: Prune (true branch) \n PRUNE(((7 > 9) != 0), true); [line 17]\n " shape="invhouse"] - 4 -> 3 ; -3 [label="3: Return Stmt \n n$0=*&SIL_temp_conditional___4:int [line 17]\n NULLIFY(&SIL_temp_conditional___4,true); [line 17]\n *&return:int =(0 + n$0) [line 17]\n REMOVE_TEMPS(n$0); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] + 4 -> 6 ; +3 [label="3: + \n " ] - 3 -> 2 ; + 3 -> 8 ; 2 [label="2: Exit foo \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/c/frontend/conditional_operator/conditional_operator.c.dot b/infer/tests/codetoanalyze/c/frontend/conditional_operator/conditional_operator.c.dot index 22d522daa..edde9f2b1 100644 --- a/infer/tests/codetoanalyze/c/frontend/conditional_operator/conditional_operator.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/conditional_operator/conditional_operator.c.dot @@ -1,28 +1,28 @@ digraph iCFG { -54 [label="54: ConditinalStmt Branch \n NULLIFY(&p,false); [line 42]\n DECLARE_LOCALS(&SIL_temp_conditional___50); [line 42]\n *&SIL_temp_conditional___50:int =0 [line 42]\n APPLY_ABSTRACTION; [line 42]\n " shape="box"] +54 [label="54: DeclStmt \n n$3=*&SIL_temp_conditional___49:int [line 42]\n NULLIFY(&SIL_temp_conditional___49,true); [line 42]\n *&z:int =n$3 [line 42]\n REMOVE_TEMPS(n$3); [line 42]\n " shape="box"] - 54 -> 50 ; -53 [label="53: UnaryOperator \n n$1=*&p:int * [line 42]\n n$2=*n$1:int [line 42]\n DECLARE_LOCALS(&SIL_temp_conditional___50); [line 42]\n *&SIL_temp_conditional___50:int =n$2 [line 42]\n REMOVE_TEMPS(n$1,n$2); [line 42]\n NULLIFY(&p,false); [line 42]\n APPLY_ABSTRACTION; [line 42]\n " shape="box"] + 54 -> 48 ; +53 [label="53: ConditinalStmt Branch \n NULLIFY(&p,false); [line 42]\n DECLARE_LOCALS(&SIL_temp_conditional___49); [line 42]\n *&SIL_temp_conditional___49:int =0 [line 42]\n APPLY_ABSTRACTION; [line 42]\n " shape="box"] - 53 -> 50 ; -52 [label="52: Prune (false branch) \n PRUNE((1 == 0), false); [line 42]\n " shape="invhouse"] + 53 -> 49 ; +52 [label="52: UnaryOperator \n n$1=*&p:int * [line 42]\n n$2=*n$1:int [line 42]\n DECLARE_LOCALS(&SIL_temp_conditional___49); [line 42]\n *&SIL_temp_conditional___49:int =n$2 [line 42]\n REMOVE_TEMPS(n$1,n$2); [line 42]\n NULLIFY(&p,false); [line 42]\n APPLY_ABSTRACTION; [line 42]\n " shape="box"] - 52 -> 54 ; -51 [label="51: Prune (true branch) \n PRUNE((1 != 0), true); [line 42]\n " shape="invhouse"] + 52 -> 49 ; +51 [label="51: Prune (false branch) \n PRUNE((1 == 0), false); [line 42]\n " shape="invhouse"] 51 -> 53 ; -50 [label="50: + \n " ] +50 [label="50: Prune (true branch) \n PRUNE((1 != 0), true); [line 42]\n " shape="invhouse"] - 50 -> 49 ; -49 [label="49: DeclStmt \n n$3=*&SIL_temp_conditional___50:int [line 42]\n NULLIFY(&SIL_temp_conditional___50,true); [line 42]\n *&z:int =n$3 [line 42]\n REMOVE_TEMPS(n$3); [line 42]\n " shape="box"] + 50 -> 52 ; +49 [label="49: + \n " ] - 49 -> 48 ; + 49 -> 54 ; 48 [label="48: Return Stmt \n n$0=*&z:int [line 43]\n *&return:int =n$0 [line 43]\n REMOVE_TEMPS(n$0); [line 43]\n NULLIFY(&z,false); [line 43]\n APPLY_ABSTRACTION; [line 43]\n " shape="box"] @@ -33,96 +33,96 @@ digraph iCFG { 46 [label="46: Start test6\nFormals: p:int *\nLocals: z:int \n DECLARE_LOCALS(&return,&z); [line 41]\n NULLIFY(&z,false); [line 41]\n " color=yellow style=filled] + 46 -> 50 ; 46 -> 51 ; - 46 -> 52 ; -45 [label="45: ConditinalStmt Branch \n NULLIFY(&b,false); [line 38]\n DECLARE_LOCALS(&SIL_temp_conditional___41); [line 38]\n *&SIL_temp_conditional___41:int =1 [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] +45 [label="45: Return Stmt \n n$2=*&SIL_temp_conditional___40:int [line 38]\n NULLIFY(&SIL_temp_conditional___40,true); [line 38]\n *&return:int =n$2 [line 38]\n REMOVE_TEMPS(n$2); [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] - 45 -> 41 ; -44 [label="44: ConditinalStmt Branch \n n$1=*&b:int [line 38]\n DECLARE_LOCALS(&SIL_temp_conditional___41); [line 38]\n *&SIL_temp_conditional___41:int =n$1 [line 38]\n REMOVE_TEMPS(n$1); [line 38]\n NULLIFY(&b,false); [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] + 45 -> 39 ; +44 [label="44: ConditinalStmt Branch \n NULLIFY(&b,false); [line 38]\n DECLARE_LOCALS(&SIL_temp_conditional___40); [line 38]\n *&SIL_temp_conditional___40:int =1 [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] - 44 -> 41 ; -43 [label="43: Prune (false branch) \n n$0=*&b:int [line 38]\n PRUNE((n$0 == 0), false); [line 38]\n REMOVE_TEMPS(n$0); [line 38]\n " shape="invhouse"] + 44 -> 40 ; +43 [label="43: ConditinalStmt Branch \n n$1=*&b:int [line 38]\n DECLARE_LOCALS(&SIL_temp_conditional___40); [line 38]\n *&SIL_temp_conditional___40:int =n$1 [line 38]\n REMOVE_TEMPS(n$1); [line 38]\n NULLIFY(&b,false); [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] - 43 -> 45 ; -42 [label="42: Prune (true branch) \n n$0=*&b:int [line 38]\n PRUNE((n$0 != 0), true); [line 38]\n REMOVE_TEMPS(n$0); [line 38]\n " shape="invhouse"] + 43 -> 40 ; +42 [label="42: Prune (false branch) \n n$0=*&b:int [line 38]\n PRUNE((n$0 == 0), false); [line 38]\n REMOVE_TEMPS(n$0); [line 38]\n " shape="invhouse"] 42 -> 44 ; -41 [label="41: + \n " ] +41 [label="41: Prune (true branch) \n n$0=*&b:int [line 38]\n PRUNE((n$0 != 0), true); [line 38]\n REMOVE_TEMPS(n$0); [line 38]\n " shape="invhouse"] - 41 -> 40 ; -40 [label="40: Return Stmt \n n$2=*&SIL_temp_conditional___41:int [line 38]\n NULLIFY(&SIL_temp_conditional___41,true); [line 38]\n *&return:int =n$2 [line 38]\n REMOVE_TEMPS(n$2); [line 38]\n APPLY_ABSTRACTION; [line 38]\n " shape="box"] + 41 -> 43 ; +40 [label="40: + \n " ] - 40 -> 39 ; + 40 -> 45 ; 39 [label="39: Exit test5 \n " color=yellow style=filled] 38 [label="38: Start test5\nFormals: b:int \nLocals: \n DECLARE_LOCALS(&return); [line 37]\n " color=yellow style=filled] + 38 -> 41 ; 38 -> 42 ; - 38 -> 43 ; -37 [label="37: ConditinalStmt Branch \n NULLIFY(&b,false); [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___33); [line 33]\n *&SIL_temp_conditional___33:int =1 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] +37 [label="37: Return Stmt \n n$2=*&SIL_temp_conditional___32:int [line 33]\n NULLIFY(&SIL_temp_conditional___32,true); [line 33]\n n$3=_fun_test2(n$2:int ) [line 33]\n *&return:int =n$3 [line 33]\n REMOVE_TEMPS(n$2,n$3); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] - 37 -> 33 ; -36 [label="36: ConditinalStmt Branch \n n$1=*&b:int [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___33); [line 33]\n *&SIL_temp_conditional___33:int =n$1 [line 33]\n REMOVE_TEMPS(n$1); [line 33]\n NULLIFY(&b,false); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] + 37 -> 31 ; +36 [label="36: ConditinalStmt Branch \n NULLIFY(&b,false); [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___32); [line 33]\n *&SIL_temp_conditional___32:int =1 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] - 36 -> 33 ; -35 [label="35: Prune (false branch) \n n$0=*&b:int [line 33]\n PRUNE((n$0 == 0), false); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] + 36 -> 32 ; +35 [label="35: ConditinalStmt Branch \n n$1=*&b:int [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___32); [line 33]\n *&SIL_temp_conditional___32:int =n$1 [line 33]\n REMOVE_TEMPS(n$1); [line 33]\n NULLIFY(&b,false); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] - 35 -> 37 ; -34 [label="34: Prune (true branch) \n n$0=*&b:int [line 33]\n PRUNE((n$0 != 0), true); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] + 35 -> 32 ; +34 [label="34: Prune (false branch) \n n$0=*&b:int [line 33]\n PRUNE((n$0 == 0), false); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] 34 -> 36 ; -33 [label="33: + \n " ] +33 [label="33: Prune (true branch) \n n$0=*&b:int [line 33]\n PRUNE((n$0 != 0), true); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] - 33 -> 32 ; -32 [label="32: Return Stmt \n n$2=*&SIL_temp_conditional___33:int [line 33]\n NULLIFY(&SIL_temp_conditional___33,true); [line 33]\n n$3=_fun_test2(n$2:int ) [line 33]\n *&return:int =n$3 [line 33]\n REMOVE_TEMPS(n$2,n$3); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] + 33 -> 35 ; +32 [label="32: + \n " ] - 32 -> 31 ; + 32 -> 37 ; 31 [label="31: Exit test4 \n " color=yellow style=filled] 30 [label="30: Start test4\nFormals: b:int \nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] + 30 -> 33 ; 30 -> 34 ; - 30 -> 35 ; -29 [label="29: ConditinalStmt Branch \n NULLIFY(&b,false); [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___25); [line 27]\n *&SIL_temp_conditional___25:int =1 [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] +29 [label="29: DeclStmt \n n$3=*&SIL_temp_conditional___24:int [line 27]\n NULLIFY(&SIL_temp_conditional___24,true); [line 27]\n *&x:int =n$3 [line 27]\n REMOVE_TEMPS(n$3); [line 27]\n " shape="box"] - 29 -> 25 ; -28 [label="28: ConditinalStmt Branch \n n$2=*&b:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___25); [line 27]\n *&SIL_temp_conditional___25:int =n$2 [line 27]\n REMOVE_TEMPS(n$2); [line 27]\n NULLIFY(&b,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] + 29 -> 23 ; +28 [label="28: ConditinalStmt Branch \n NULLIFY(&b,false); [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___24); [line 27]\n *&SIL_temp_conditional___24:int =1 [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 28 -> 25 ; -27 [label="27: Prune (false branch) \n n$1=*&b:int [line 27]\n PRUNE((n$1 == 0), false); [line 27]\n REMOVE_TEMPS(n$1); [line 27]\n " shape="invhouse"] + 28 -> 24 ; +27 [label="27: ConditinalStmt Branch \n n$2=*&b:int [line 27]\n DECLARE_LOCALS(&SIL_temp_conditional___24); [line 27]\n *&SIL_temp_conditional___24:int =n$2 [line 27]\n REMOVE_TEMPS(n$2); [line 27]\n NULLIFY(&b,false); [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] - 27 -> 29 ; -26 [label="26: Prune (true branch) \n n$1=*&b:int [line 27]\n PRUNE((n$1 != 0), true); [line 27]\n REMOVE_TEMPS(n$1); [line 27]\n " shape="invhouse"] + 27 -> 24 ; +26 [label="26: Prune (false branch) \n n$1=*&b:int [line 27]\n PRUNE((n$1 == 0), false); [line 27]\n REMOVE_TEMPS(n$1); [line 27]\n " shape="invhouse"] 26 -> 28 ; -25 [label="25: + \n " ] +25 [label="25: Prune (true branch) \n n$1=*&b:int [line 27]\n PRUNE((n$1 != 0), true); [line 27]\n REMOVE_TEMPS(n$1); [line 27]\n " shape="invhouse"] - 25 -> 24 ; -24 [label="24: DeclStmt \n n$3=*&SIL_temp_conditional___25:int [line 27]\n NULLIFY(&SIL_temp_conditional___25,true); [line 27]\n *&x:int =n$3 [line 27]\n REMOVE_TEMPS(n$3); [line 27]\n " shape="box"] + 25 -> 27 ; +24 [label="24: + \n " ] - 24 -> 23 ; + 24 -> 29 ; 23 [label="23: Return Stmt \n n$0=*&x:int [line 28]\n *&return:int =n$0 [line 28]\n REMOVE_TEMPS(n$0); [line 28]\n NULLIFY(&x,false); [line 28]\n APPLY_ABSTRACTION; [line 28]\n " shape="box"] @@ -133,32 +133,32 @@ digraph iCFG { 21 [label="21: Start test3\nFormals: b:int \nLocals: x:int \n DECLARE_LOCALS(&return,&x); [line 26]\n NULLIFY(&x,false); [line 26]\n " color=yellow style=filled] + 21 -> 25 ; 21 -> 26 ; - 21 -> 27 ; -20 [label="20: ConditinalStmt Branch \n NULLIFY(&b,false); [line 22]\n DECLARE_LOCALS(&SIL_temp_conditional___16); [line 22]\n *&SIL_temp_conditional___16:int =1 [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] +20 [label="20: DeclStmt \n n$3=*&SIL_temp_conditional___15:int [line 22]\n NULLIFY(&SIL_temp_conditional___15,true); [line 22]\n *&x:int =n$3 [line 22]\n REMOVE_TEMPS(n$3); [line 22]\n " shape="box"] - 20 -> 16 ; -19 [label="19: ConditinalStmt Branch \n n$2=*&b:int [line 22]\n DECLARE_LOCALS(&SIL_temp_conditional___16); [line 22]\n *&SIL_temp_conditional___16:int =n$2 [line 22]\n REMOVE_TEMPS(n$2); [line 22]\n NULLIFY(&b,false); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] + 20 -> 14 ; +19 [label="19: ConditinalStmt Branch \n NULLIFY(&b,false); [line 22]\n DECLARE_LOCALS(&SIL_temp_conditional___15); [line 22]\n *&SIL_temp_conditional___15:int =1 [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] - 19 -> 16 ; -18 [label="18: Prune (false branch) \n n$1=*&b:int [line 22]\n PRUNE((n$1 == 0), false); [line 22]\n REMOVE_TEMPS(n$1); [line 22]\n " shape="invhouse"] + 19 -> 15 ; +18 [label="18: ConditinalStmt Branch \n n$2=*&b:int [line 22]\n DECLARE_LOCALS(&SIL_temp_conditional___15); [line 22]\n *&SIL_temp_conditional___15:int =n$2 [line 22]\n REMOVE_TEMPS(n$2); [line 22]\n NULLIFY(&b,false); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] - 18 -> 20 ; -17 [label="17: Prune (true branch) \n n$1=*&b:int [line 22]\n PRUNE((n$1 != 0), true); [line 22]\n REMOVE_TEMPS(n$1); [line 22]\n " shape="invhouse"] + 18 -> 15 ; +17 [label="17: Prune (false branch) \n n$1=*&b:int [line 22]\n PRUNE((n$1 == 0), false); [line 22]\n REMOVE_TEMPS(n$1); [line 22]\n " shape="invhouse"] 17 -> 19 ; -16 [label="16: + \n " ] +16 [label="16: Prune (true branch) \n n$1=*&b:int [line 22]\n PRUNE((n$1 != 0), true); [line 22]\n REMOVE_TEMPS(n$1); [line 22]\n " shape="invhouse"] - 16 -> 15 ; -15 [label="15: DeclStmt \n n$3=*&SIL_temp_conditional___16:int [line 22]\n NULLIFY(&SIL_temp_conditional___16,true); [line 22]\n *&x:int =n$3 [line 22]\n REMOVE_TEMPS(n$3); [line 22]\n " shape="box"] + 16 -> 18 ; +15 [label="15: + \n " ] - 15 -> 14 ; + 15 -> 20 ; 14 [label="14: Return Stmt \n n$0=*&x:int [line 23]\n *&return:int =n$0 [line 23]\n REMOVE_TEMPS(n$0); [line 23]\n NULLIFY(&x,false); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] @@ -169,40 +169,40 @@ digraph iCFG { 12 [label="12: Start test1\nFormals: b:int \nLocals: x:int \n DECLARE_LOCALS(&return,&x); [line 21]\n NULLIFY(&x,false); [line 21]\n " color=yellow style=filled] + 12 -> 16 ; 12 -> 17 ; - 12 -> 18 ; -11 [label="11: ConditinalStmt Branch \n NULLIFY(&b,false); [line 18]\n DECLARE_LOCALS(&SIL_temp_conditional___7); [line 18]\n *&SIL_temp_conditional___7:int =1 [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] +11 [label="11: Return Stmt \n n$2=*&SIL_temp_conditional___6:int [line 18]\n NULLIFY(&SIL_temp_conditional___6,true); [line 18]\n n$3=_fun_test2(n$2:int ) [line 18]\n *&return:int =n$3 [line 18]\n REMOVE_TEMPS(n$2,n$3); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] - 11 -> 7 ; -10 [label="10: ConditinalStmt Branch \n n$1=*&b:int [line 18]\n DECLARE_LOCALS(&SIL_temp_conditional___7); [line 18]\n *&SIL_temp_conditional___7:int =n$1 [line 18]\n REMOVE_TEMPS(n$1); [line 18]\n NULLIFY(&b,false); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] + 11 -> 5 ; +10 [label="10: ConditinalStmt Branch \n NULLIFY(&b,false); [line 18]\n DECLARE_LOCALS(&SIL_temp_conditional___6); [line 18]\n *&SIL_temp_conditional___6:int =1 [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] - 10 -> 7 ; -9 [label="9: Prune (false branch) \n n$0=*&b:int [line 18]\n PRUNE((n$0 == 0), false); [line 18]\n REMOVE_TEMPS(n$0); [line 18]\n " shape="invhouse"] + 10 -> 6 ; +9 [label="9: ConditinalStmt Branch \n n$1=*&b:int [line 18]\n DECLARE_LOCALS(&SIL_temp_conditional___6); [line 18]\n *&SIL_temp_conditional___6:int =n$1 [line 18]\n REMOVE_TEMPS(n$1); [line 18]\n NULLIFY(&b,false); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] - 9 -> 11 ; -8 [label="8: Prune (true branch) \n n$0=*&b:int [line 18]\n PRUNE((n$0 != 0), true); [line 18]\n REMOVE_TEMPS(n$0); [line 18]\n " shape="invhouse"] + 9 -> 6 ; +8 [label="8: Prune (false branch) \n n$0=*&b:int [line 18]\n PRUNE((n$0 == 0), false); [line 18]\n REMOVE_TEMPS(n$0); [line 18]\n " shape="invhouse"] 8 -> 10 ; -7 [label="7: + \n " ] +7 [label="7: Prune (true branch) \n n$0=*&b:int [line 18]\n PRUNE((n$0 != 0), true); [line 18]\n REMOVE_TEMPS(n$0); [line 18]\n " shape="invhouse"] - 7 -> 6 ; -6 [label="6: Return Stmt \n n$2=*&SIL_temp_conditional___7:int [line 18]\n NULLIFY(&SIL_temp_conditional___7,true); [line 18]\n n$3=_fun_test2(n$2:int ) [line 18]\n *&return:int =n$3 [line 18]\n REMOVE_TEMPS(n$2,n$3); [line 18]\n APPLY_ABSTRACTION; [line 18]\n " shape="box"] + 7 -> 9 ; +6 [label="6: + \n " ] - 6 -> 5 ; + 6 -> 11 ; 5 [label="5: Exit test \n " color=yellow style=filled] 4 [label="4: Start test\nFormals: b:int \nLocals: \n DECLARE_LOCALS(&return); [line 17]\n " color=yellow style=filled] + 4 -> 7 ; 4 -> 8 ; - 4 -> 9 ; 3 [label="3: Return Stmt \n n$0=*&x:int [line 13]\n *&return:int =n$0 [line 13]\n REMOVE_TEMPS(n$0); [line 13]\n NULLIFY(&x,false); [line 13]\n APPLY_ABSTRACTION; [line 13]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/c/frontend/conditional_operator/int_negation.c.dot b/infer/tests/codetoanalyze/c/frontend/conditional_operator/int_negation.c.dot index 33744bffb..24d706e3a 100644 --- a/infer/tests/codetoanalyze/c/frontend/conditional_operator/int_negation.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/conditional_operator/int_negation.c.dot @@ -1,36 +1,36 @@ digraph iCFG { -32 [label="32: ConditinalStmt Branch \n NULLIFY(&x,false); [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___28); [line 33]\n *&SIL_temp_conditional___28:int =1 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] +32 [label="32: Return Stmt \n n$1=*&SIL_temp_conditional___27:int [line 33]\n NULLIFY(&SIL_temp_conditional___27,true); [line 33]\n *&return:int =n$1 [line 33]\n REMOVE_TEMPS(n$1); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] - 32 -> 28 ; -31 [label="31: ConditinalStmt Branch \n NULLIFY(&x,false); [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___28); [line 33]\n *&SIL_temp_conditional___28:int =0 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] + 32 -> 26 ; +31 [label="31: ConditinalStmt Branch \n NULLIFY(&x,false); [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___27); [line 33]\n *&SIL_temp_conditional___27:int =1 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] - 31 -> 28 ; -30 [label="30: Prune (false branch) \n n$0=*&x:int [line 33]\n PRUNE((n$0 == 0), false); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] + 31 -> 27 ; +30 [label="30: ConditinalStmt Branch \n NULLIFY(&x,false); [line 33]\n DECLARE_LOCALS(&SIL_temp_conditional___27); [line 33]\n *&SIL_temp_conditional___27:int =0 [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] - 30 -> 32 ; -29 [label="29: Prune (true branch) \n n$0=*&x:int [line 33]\n PRUNE((n$0 != 0), true); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] + 30 -> 27 ; +29 [label="29: Prune (false branch) \n n$0=*&x:int [line 33]\n PRUNE((n$0 == 0), false); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] 29 -> 31 ; -28 [label="28: + \n " ] +28 [label="28: Prune (true branch) \n n$0=*&x:int [line 33]\n PRUNE((n$0 != 0), true); [line 33]\n REMOVE_TEMPS(n$0); [line 33]\n " shape="invhouse"] - 28 -> 27 ; -27 [label="27: Return Stmt \n n$1=*&SIL_temp_conditional___28:int [line 33]\n NULLIFY(&SIL_temp_conditional___28,true); [line 33]\n *&return:int =n$1 [line 33]\n REMOVE_TEMPS(n$1); [line 33]\n APPLY_ABSTRACTION; [line 33]\n " shape="box"] + 28 -> 30 ; +27 [label="27: + \n " ] - 27 -> 26 ; + 27 -> 32 ; 26 [label="26: Exit neg \n " color=yellow style=filled] 25 [label="25: Start neg\nFormals: x:int \nLocals: \n DECLARE_LOCALS(&return); [line 32]\n " color=yellow style=filled] + 25 -> 28 ; 25 -> 29 ; - 25 -> 30 ; 24 [label="24: Return Stmt \n *&return:int =0 [line 28]\n APPLY_ABSTRACTION; [line 28]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/c/frontend/conditional_operator/member_access.c.dot b/infer/tests/codetoanalyze/c/frontend/conditional_operator/member_access.c.dot index 2291d532d..3d9566b5c 100644 --- a/infer/tests/codetoanalyze/c/frontend/conditional_operator/member_access.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/conditional_operator/member_access.c.dot @@ -1,98 +1,98 @@ digraph iCFG { -24 [label="24: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___20); [line 25]\n *&SIL_temp_conditional___20:int =0 [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] +24 [label="24: DeclStmt \n n$2=*&SIL_temp_conditional___19:int [line 25]\n NULLIFY(&SIL_temp_conditional___19,true); [line 25]\n *&z:int =n$2 [line 25]\n REMOVE_TEMPS(n$2); [line 25]\n NULLIFY(&z,false); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] - 24 -> 20 ; -23 [label="23: Call _fun_ret_ptr \n n$0=_fun_ret_ptr(4:int ) [line 25]\n n$1=*n$0.field:int [line 25]\n DECLARE_LOCALS(&SIL_temp_conditional___20); [line 25]\n *&SIL_temp_conditional___20:int =n$1 [line 25]\n REMOVE_TEMPS(n$0,n$1); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] + 24 -> 18 ; +23 [label="23: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___19); [line 25]\n *&SIL_temp_conditional___19:int =0 [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] - 23 -> 20 ; -22 [label="22: Prune (false branch) \n PRUNE((1 == 0), false); [line 25]\n " shape="invhouse"] + 23 -> 19 ; +22 [label="22: Call _fun_ret_ptr \n n$0=_fun_ret_ptr(4:int ) [line 25]\n n$1=*n$0.field:int [line 25]\n DECLARE_LOCALS(&SIL_temp_conditional___19); [line 25]\n *&SIL_temp_conditional___19:int =n$1 [line 25]\n REMOVE_TEMPS(n$0,n$1); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] - 22 -> 24 ; -21 [label="21: Prune (true branch) \n PRUNE((1 != 0), true); [line 25]\n " shape="invhouse"] + 22 -> 19 ; +21 [label="21: Prune (false branch) \n PRUNE((1 == 0), false); [line 25]\n " shape="invhouse"] 21 -> 23 ; -20 [label="20: + \n " ] +20 [label="20: Prune (true branch) \n PRUNE((1 != 0), true); [line 25]\n " shape="invhouse"] - 20 -> 19 ; -19 [label="19: DeclStmt \n n$2=*&SIL_temp_conditional___20:int [line 25]\n NULLIFY(&SIL_temp_conditional___20,true); [line 25]\n *&z:int =n$2 [line 25]\n REMOVE_TEMPS(n$2); [line 25]\n NULLIFY(&z,false); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] + 20 -> 22 ; +19 [label="19: + \n " ] - 19 -> 18 ; + 19 -> 24 ; 18 [label="18: Exit access_field_in_ife_branch \n " color=yellow style=filled] 17 [label="17: Start access_field_in_ife_branch\nFormals: \nLocals: z:int \n DECLARE_LOCALS(&return,&z); [line 24]\n NULLIFY(&z,false); [line 24]\n " color=yellow style=filled] + 17 -> 20 ; 17 -> 21 ; - 17 -> 22 ; -16 [label="16: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___12); [line 21]\n *&SIL_temp_conditional___12:int =3 [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] +16 [label="16: DeclStmt \n n$0=*&SIL_temp_conditional___11:int [line 21]\n NULLIFY(&SIL_temp_conditional___11,true); [line 21]\n n$1=_fun_ret_ptr(n$0:int ) [line 21]\n n$2=*n$1.field:int [line 21]\n *&z:int =n$2 [line 21]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 21]\n NULLIFY(&z,false); [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] - 16 -> 12 ; -15 [label="15: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___12); [line 21]\n *&SIL_temp_conditional___12:int =2 [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] + 16 -> 10 ; +15 [label="15: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___11); [line 21]\n *&SIL_temp_conditional___11:int =3 [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] - 15 -> 12 ; -14 [label="14: Prune (false branch) \n PRUNE((1 == 0), false); [line 21]\n " shape="invhouse"] + 15 -> 11 ; +14 [label="14: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___11); [line 21]\n *&SIL_temp_conditional___11:int =2 [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] - 14 -> 16 ; -13 [label="13: Prune (true branch) \n PRUNE((1 != 0), true); [line 21]\n " shape="invhouse"] + 14 -> 11 ; +13 [label="13: Prune (false branch) \n PRUNE((1 == 0), false); [line 21]\n " shape="invhouse"] 13 -> 15 ; -12 [label="12: + \n " ] +12 [label="12: Prune (true branch) \n PRUNE((1 != 0), true); [line 21]\n " shape="invhouse"] - 12 -> 11 ; -11 [label="11: DeclStmt \n n$0=*&SIL_temp_conditional___12:int [line 21]\n NULLIFY(&SIL_temp_conditional___12,true); [line 21]\n n$1=_fun_ret_ptr(n$0:int ) [line 21]\n n$2=*n$1.field:int [line 21]\n *&z:int =n$2 [line 21]\n REMOVE_TEMPS(n$0,n$1,n$2); [line 21]\n NULLIFY(&z,false); [line 21]\n APPLY_ABSTRACTION; [line 21]\n " shape="box"] + 12 -> 14 ; +11 [label="11: + \n " ] - 11 -> 10 ; + 11 -> 16 ; 10 [label="10: Exit call_ife_then_access_field \n " color=yellow style=filled] 9 [label="9: Start call_ife_then_access_field\nFormals: \nLocals: z:int \n DECLARE_LOCALS(&return,&z); [line 20]\n NULLIFY(&z,false); [line 20]\n " color=yellow style=filled] + 9 -> 12 ; 9 -> 13 ; - 9 -> 14 ; -8 [label="8: ConditinalStmt Branch \n NULLIFY(&p,false); [line 17]\n n$1=*&q:struct s * [line 17]\n DECLARE_LOCALS(&SIL_temp_conditional___4); [line 17]\n *&SIL_temp_conditional___4:struct s *=n$1 [line 17]\n REMOVE_TEMPS(n$1); [line 17]\n NULLIFY(&q,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] +8 [label="8: DeclStmt \n n$2=*&SIL_temp_conditional___3:struct s * [line 17]\n NULLIFY(&SIL_temp_conditional___3,true); [line 17]\n n$3=*n$2.field:int [line 17]\n *&z:int =n$3 [line 17]\n REMOVE_TEMPS(n$2,n$3); [line 17]\n NULLIFY(&z,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] - 8 -> 4 ; -7 [label="7: ConditinalStmt Branch \n NULLIFY(&q,false); [line 17]\n n$0=*&p:struct s * [line 17]\n DECLARE_LOCALS(&SIL_temp_conditional___4); [line 17]\n *&SIL_temp_conditional___4:struct s *=n$0 [line 17]\n REMOVE_TEMPS(n$0); [line 17]\n NULLIFY(&p,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] + 8 -> 2 ; +7 [label="7: ConditinalStmt Branch \n NULLIFY(&p,false); [line 17]\n n$1=*&q:struct s * [line 17]\n DECLARE_LOCALS(&SIL_temp_conditional___3); [line 17]\n *&SIL_temp_conditional___3:struct s *=n$1 [line 17]\n REMOVE_TEMPS(n$1); [line 17]\n NULLIFY(&q,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] - 7 -> 4 ; -6 [label="6: Prune (false branch) \n PRUNE((1 == 0), false); [line 17]\n " shape="invhouse"] + 7 -> 3 ; +6 [label="6: ConditinalStmt Branch \n NULLIFY(&q,false); [line 17]\n n$0=*&p:struct s * [line 17]\n DECLARE_LOCALS(&SIL_temp_conditional___3); [line 17]\n *&SIL_temp_conditional___3:struct s *=n$0 [line 17]\n REMOVE_TEMPS(n$0); [line 17]\n NULLIFY(&p,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] - 6 -> 8 ; -5 [label="5: Prune (true branch) \n PRUNE((1 != 0), true); [line 17]\n " shape="invhouse"] + 6 -> 3 ; +5 [label="5: Prune (false branch) \n PRUNE((1 == 0), false); [line 17]\n " shape="invhouse"] 5 -> 7 ; -4 [label="4: + \n " ] +4 [label="4: Prune (true branch) \n PRUNE((1 != 0), true); [line 17]\n " shape="invhouse"] - 4 -> 3 ; -3 [label="3: DeclStmt \n n$2=*&SIL_temp_conditional___4:struct s * [line 17]\n NULLIFY(&SIL_temp_conditional___4,true); [line 17]\n n$3=*n$2.field:int [line 17]\n *&z:int =n$3 [line 17]\n REMOVE_TEMPS(n$2,n$3); [line 17]\n NULLIFY(&z,false); [line 17]\n APPLY_ABSTRACTION; [line 17]\n " shape="box"] + 4 -> 6 ; +3 [label="3: + \n " ] - 3 -> 2 ; + 3 -> 8 ; 2 [label="2: Exit ife_then_access_field \n " color=yellow style=filled] 1 [label="1: Start ife_then_access_field\nFormals: p:struct s * q:struct s *\nLocals: z:int \n DECLARE_LOCALS(&return,&z); [line 16]\n NULLIFY(&z,false); [line 16]\n " color=yellow style=filled] + 1 -> 4 ; 1 -> 5 ; - 1 -> 6 ; } diff --git a/infer/tests/codetoanalyze/c/frontend/conditional_operator/unary_operator.c.dot b/infer/tests/codetoanalyze/c/frontend/conditional_operator/unary_operator.c.dot index b39e62800..e54b2e21c 100644 --- a/infer/tests/codetoanalyze/c/frontend/conditional_operator/unary_operator.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/conditional_operator/unary_operator.c.dot @@ -2,8 +2,8 @@ digraph iCFG { 20 [label="20: BinaryOperatorStmt: Assign \n n$10=*&SIL_temp_conditional___15:int * [line 12]\n NULLIFY(&SIL_temp_conditional___15,true); [line 12]\n n$11=*n$10:int [line 12]\n *&x:int =n$11 [line 12]\n REMOVE_TEMPS(n$10,n$11); [line 12]\n NULLIFY(&x,false); [line 12]\n " shape="box"] + 20 -> 10 ; 20 -> 11 ; - 20 -> 12 ; 19 [label="19: ConditinalStmt Branch \n n$9=*&p:int * [line 12]\n DECLARE_LOCALS(&SIL_temp_conditional___15); [line 12]\n *&SIL_temp_conditional___15:int *=n$9 [line 12]\n REMOVE_TEMPS(n$9); [line 12]\n APPLY_ABSTRACTION; [line 12]\n " shape="box"] @@ -24,31 +24,31 @@ digraph iCFG { 15 -> 20 ; -14 [label="14: ConditinalStmt Branch \n n$5=*&p:int * [line 14]\n DECLARE_LOCALS(&SIL_temp_conditional___10); [line 14]\n *&SIL_temp_conditional___10:int *=n$5 [line 14]\n REMOVE_TEMPS(n$5); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] +14 [label="14: DeclStmt \n n$6=*&SIL_temp_conditional___9:int * [line 14]\n NULLIFY(&SIL_temp_conditional___9,true); [line 14]\n n$7=*n$6:int [line 14]\n *&y:int =n$7 [line 14]\n REMOVE_TEMPS(n$6,n$7); [line 14]\n NULLIFY(&y,false); [line 14]\n " shape="box"] - 14 -> 10 ; -13 [label="13: ConditinalStmt Branch \n n$4=*&p:int * [line 14]\n DECLARE_LOCALS(&SIL_temp_conditional___10); [line 14]\n *&SIL_temp_conditional___10:int *=n$4 [line 14]\n REMOVE_TEMPS(n$4); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] + 14 -> 4 ; + 14 -> 5 ; +13 [label="13: ConditinalStmt Branch \n n$5=*&p:int * [line 14]\n DECLARE_LOCALS(&SIL_temp_conditional___9); [line 14]\n *&SIL_temp_conditional___9:int *=n$5 [line 14]\n REMOVE_TEMPS(n$5); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] - 13 -> 10 ; -12 [label="12: Prune (false branch) \n PRUNE((1 == 0), false); [line 14]\n " shape="invhouse"] + 13 -> 9 ; +12 [label="12: ConditinalStmt Branch \n n$4=*&p:int * [line 14]\n DECLARE_LOCALS(&SIL_temp_conditional___9); [line 14]\n *&SIL_temp_conditional___9:int *=n$4 [line 14]\n REMOVE_TEMPS(n$4); [line 14]\n APPLY_ABSTRACTION; [line 14]\n " shape="box"] - 12 -> 14 ; -11 [label="11: Prune (true branch) \n PRUNE((1 != 0), true); [line 14]\n " shape="invhouse"] + 12 -> 9 ; +11 [label="11: Prune (false branch) \n PRUNE((1 == 0), false); [line 14]\n " shape="invhouse"] 11 -> 13 ; -10 [label="10: + \n " ] +10 [label="10: Prune (true branch) \n PRUNE((1 != 0), true); [line 14]\n " shape="invhouse"] - 10 -> 9 ; -9 [label="9: DeclStmt \n n$6=*&SIL_temp_conditional___10:int * [line 14]\n NULLIFY(&SIL_temp_conditional___10,true); [line 14]\n n$7=*n$6:int [line 14]\n *&y:int =n$7 [line 14]\n REMOVE_TEMPS(n$6,n$7); [line 14]\n NULLIFY(&y,false); [line 14]\n " shape="box"] + 10 -> 12 ; +9 [label="9: + \n " ] - 9 -> 4 ; - 9 -> 5 ; + 9 -> 14 ; 8 [label="8: UnaryOperator \n n$2=*&SIL_temp_conditional___3:int * [line 16]\n NULLIFY(&SIL_temp_conditional___3,true); [line 16]\n REMOVE_TEMPS(n$2); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_if.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_if.cpp.dot index 5a96bc4e8..3708ee741 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_if.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_if.cpp.dot @@ -71,31 +71,31 @@ digraph iCFG { 50 -> 40 ; -49 [label="49: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___45); [line 45]\n *&SIL_temp_conditional___45:int =0 [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] +49 [label="49: DeclStmt \n n$1=*&SIL_temp_conditional___44:int [line 45]\n NULLIFY(&SIL_temp_conditional___44,true); [line 45]\n *&a:int =n$1 [line 45]\n REMOVE_TEMPS(n$1); [line 45]\n " shape="box"] - 49 -> 45 ; -48 [label="48: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___45); [line 45]\n *&SIL_temp_conditional___45:int =1 [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] + 49 -> 42 ; + 49 -> 43 ; +48 [label="48: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___44); [line 45]\n *&SIL_temp_conditional___44:int =0 [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] - 48 -> 45 ; -47 [label="47: Prune (false branch) \n PRUNE((1 == 0), false); [line 45]\n " shape="invhouse"] + 48 -> 44 ; +47 [label="47: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___44); [line 45]\n *&SIL_temp_conditional___44:int =1 [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] - 47 -> 49 ; -46 [label="46: Prune (true branch) \n PRUNE((1 != 0), true); [line 45]\n " shape="invhouse"] + 47 -> 44 ; +46 [label="46: Prune (false branch) \n PRUNE((1 == 0), false); [line 45]\n " shape="invhouse"] 46 -> 48 ; -45 [label="45: + \n " ] +45 [label="45: Prune (true branch) \n PRUNE((1 != 0), true); [line 45]\n " shape="invhouse"] - 45 -> 44 ; -44 [label="44: DeclStmt \n n$1=*&SIL_temp_conditional___45:int [line 45]\n NULLIFY(&SIL_temp_conditional___45,true); [line 45]\n *&a:int =n$1 [line 45]\n REMOVE_TEMPS(n$1); [line 45]\n " shape="box"] + 45 -> 47 ; +44 [label="44: + \n " ] - 44 -> 42 ; - 44 -> 43 ; + 44 -> 49 ; 43 [label="43: Prune (false branch) \n n$0=*&a:int [line 45]\n PRUNE((n$0 == 0), false); [line 45]\n REMOVE_TEMPS(n$0); [line 45]\n " shape="invhouse"] @@ -114,8 +114,8 @@ digraph iCFG { 39 [label="39: Start conditional_init_div0\nFormals: \nLocals: a:int \n DECLARE_LOCALS(&return,&a); [line 44]\n NULLIFY(&a,false); [line 44]\n " color=yellow style=filled] + 39 -> 45 ; 39 -> 46 ; - 39 -> 47 ; 38 [label="38: Return Stmt \n n$2=*&a:int [line 40]\n *&return:int =(1 / (n$2 - 1)) [line 40]\n REMOVE_TEMPS(n$2); [line 40]\n NULLIFY(&a,false); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_while.cpp.dot b/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_while.cpp.dot index f6abc27a1..0e2f89f94 100644 --- a/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_while.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/frontend/nestedoperators/var_decl_inside_while.cpp.dot @@ -15,36 +15,36 @@ digraph iCFG { 25 -> 15 ; -24 [label="24: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___19); [line 23]\n *&SIL_temp_conditional___19:int =0 [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] +24 [label="24: DeclStmt \n n$3=*&SIL_temp_conditional___18:int [line 23]\n NULLIFY(&SIL_temp_conditional___18,true); [line 23]\n *&a:int =n$3 [line 23]\n REMOVE_TEMPS(n$3); [line 23]\n " shape="box"] - 24 -> 19 ; -23 [label="23: ConditinalStmt Branch \n n$2=*&x:int [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___19); [line 23]\n *&SIL_temp_conditional___19:int =n$2 [line 23]\n REMOVE_TEMPS(n$2); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] + 24 -> 16 ; + 24 -> 17 ; +23 [label="23: ConditinalStmt Branch \n DECLARE_LOCALS(&SIL_temp_conditional___18); [line 23]\n *&SIL_temp_conditional___18:int =0 [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] - 23 -> 19 ; -22 [label="22: Prune (false branch) \n PRUNE(((n$1 > 0) == 0), false); [line 23]\n REMOVE_TEMPS(n$1); [line 23]\n " shape="invhouse"] + 23 -> 18 ; +22 [label="22: ConditinalStmt Branch \n n$2=*&x:int [line 23]\n DECLARE_LOCALS(&SIL_temp_conditional___18); [line 23]\n *&SIL_temp_conditional___18:int =n$2 [line 23]\n REMOVE_TEMPS(n$2); [line 23]\n APPLY_ABSTRACTION; [line 23]\n " shape="box"] - 22 -> 24 ; -21 [label="21: Prune (true branch) \n PRUNE(((n$1 > 0) != 0), true); [line 23]\n REMOVE_TEMPS(n$1); [line 23]\n " shape="invhouse"] + 22 -> 18 ; +21 [label="21: Prune (false branch) \n PRUNE(((n$1 > 0) == 0), false); [line 23]\n REMOVE_TEMPS(n$1); [line 23]\n " shape="invhouse"] 21 -> 23 ; -20 [label="20: BinaryOperatorStmt: GT \n n$1=*&x:int [line 23]\n " shape="box"] +20 [label="20: Prune (true branch) \n PRUNE(((n$1 > 0) != 0), true); [line 23]\n REMOVE_TEMPS(n$1); [line 23]\n " shape="invhouse"] - 20 -> 21 ; 20 -> 22 ; -19 [label="19: + \n " ] +19 [label="19: BinaryOperatorStmt: GT \n n$1=*&x:int [line 23]\n " shape="box"] - 19 -> 18 ; -18 [label="18: DeclStmt \n n$3=*&SIL_temp_conditional___19:int [line 23]\n NULLIFY(&SIL_temp_conditional___19,true); [line 23]\n *&a:int =n$3 [line 23]\n REMOVE_TEMPS(n$3); [line 23]\n " shape="box"] + 19 -> 20 ; + 19 -> 21 ; +18 [label="18: + \n " ] - 18 -> 16 ; - 18 -> 17 ; + 18 -> 24 ; 17 [label="17: Prune (false branch) \n n$0=*&a:int [line 23]\n PRUNE((n$0 == 0), false); [line 23]\n REMOVE_TEMPS(n$0); [line 23]\n " shape="invhouse"] @@ -56,7 +56,7 @@ digraph iCFG { 15 [label="15: + \n " ] - 15 -> 20 ; + 15 -> 19 ; 14 [label="14: Return Stmt \n NULLIFY(&a,false); [line 27]\n NULLIFY(&result,false); [line 27]\n NULLIFY(&x,false); [line 27]\n *&return:int =0 [line 27]\n APPLY_ABSTRACTION; [line 27]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot index 18ad1861f..820fd542d 100644 --- a/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot +++ b/infer/tests/codetoanalyze/objc/frontend/assertions/NSAssert_example.dot @@ -98,7 +98,7 @@ digraph iCFG { 100 [label="100: Prune (false branch) \n PRUNE((0 == 0), false); [line 36]\n " shape="invhouse"] - 100 -> 94 ; + 100 -> 97 ; 99 [label="99: Prune (true branch) \n PRUNE((0 != 0), true); [line 36]\n APPLY_ABSTRACTION; [line 36]\n " shape="invhouse"] @@ -108,21 +108,21 @@ digraph iCFG { 98 -> 103 ; 98 -> 104 ; -97 [label="97: Return Stmt \n n$2=*&self:class A * [line 13]\n n$3=*n$2._x:int [line 13]\n *&return:int =n$3 [line 13]\n REMOVE_TEMPS(n$2,n$3); [line 13]\n NULLIFY(&self,false); [line 13]\n APPLY_ABSTRACTION; [line 13]\n " shape="box"] +97 [label="97: Return Stmt \n n$1=*&target:class A * [line 37]\n n$0=_fun_A_x(n$1:class A *) virtual [line 37]\n *&return:int =n$0 [line 37]\n REMOVE_TEMPS(n$0,n$1); [line 37]\n NULLIFY(&target,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] - 97 -> 96 ; -96 [label="96: Exit A_x \n " color=yellow style=filled] + 97 -> 93 ; +96 [label="96: Return Stmt \n n$2=*&self:class A * [line 13]\n n$3=*n$2._x:int [line 13]\n *&return:int =n$3 [line 13]\n REMOVE_TEMPS(n$2,n$3); [line 13]\n NULLIFY(&self,false); [line 13]\n APPLY_ABSTRACTION; [line 13]\n " shape="box"] -95 [label="95: Start A_x (generated)\nFormals: self:class A *\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] + 96 -> 95 ; +95 [label="95: Exit A_x \n " color=yellow style=filled] - 95 -> 97 ; -94 [label="94: Return Stmt \n n$1=*&target:class A * [line 37]\n n$0=_fun_A_x(n$1:class A *) virtual [line 37]\n *&return:int =n$0 [line 37]\n REMOVE_TEMPS(n$0,n$1); [line 37]\n NULLIFY(&target,false); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +94 [label="94: Start A_x (generated)\nFormals: self:class A *\nLocals: \n DECLARE_LOCALS(&return); [line 13]\n " color=yellow style=filled] - 94 -> 93 ; + 94 -> 96 ; 93 [label="93: Exit test2 \n " color=yellow style=filled] @@ -234,7 +234,7 @@ digraph iCFG { 67 [label="67: Prune (false branch) \n PRUNE((0 == 0), false); [line 31]\n " shape="invhouse"] - 67 -> 61 ; + 67 -> 64 ; 66 [label="66: Prune (true branch) \n PRUNE((0 != 0), true); [line 31]\n APPLY_ABSTRACTION; [line 31]\n " shape="invhouse"] @@ -243,10 +243,10 @@ digraph iCFG { 65 -> 70 ; -61 [label="61: Return Stmt \n n$1=*&target:class A * [line 32]\n n$0=_fun_A_x(n$1:class A *) virtual [line 32]\n *&return:int =n$0 [line 32]\n REMOVE_TEMPS(n$0,n$1); [line 32]\n NULLIFY(&target,false); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] +64 [label="64: Return Stmt \n n$1=*&target:class A * [line 32]\n n$0=_fun_A_x(n$1:class A *) virtual [line 32]\n *&return:int =n$0 [line 32]\n REMOVE_TEMPS(n$0,n$1); [line 32]\n NULLIFY(&target,false); [line 32]\n APPLY_ABSTRACTION; [line 32]\n " shape="box"] - 61 -> 60 ; + 64 -> 60 ; 60 [label="60: Exit test1 \n " color=yellow style=filled] @@ -340,7 +340,7 @@ digraph iCFG { 35 [label="35: Prune (false branch) \n PRUNE((0 == 0), false); [line 24]\n " shape="invhouse"] - 35 -> 29 ; + 35 -> 32 ; 34 [label="34: Prune (true branch) \n PRUNE((0 != 0), true); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="invhouse"] @@ -349,10 +349,10 @@ digraph iCFG { 33 -> 38 ; -29 [label="29: Return Stmt \n n$18=*&a:class A * [line 25]\n n$17=_fun_A_x(n$18:class A *) virtual [line 25]\n *&return:int =n$17 [line 25]\n REMOVE_TEMPS(n$17,n$18); [line 25]\n NULLIFY(&a,false); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] +32 [label="32: Return Stmt \n n$18=*&a:class A * [line 25]\n n$17=_fun_A_x(n$18:class A *) virtual [line 25]\n *&return:int =n$17 [line 25]\n REMOVE_TEMPS(n$17,n$18); [line 25]\n NULLIFY(&a,false); [line 25]\n APPLY_ABSTRACTION; [line 25]\n " shape="box"] - 29 -> 28 ; + 32 -> 28 ; 28 [label="28: Exit A_initWithRequest: \n " color=yellow style=filled] @@ -435,7 +435,7 @@ digraph iCFG { 9 [label="9: Prune (false branch) \n PRUNE((0 == 0), false); [line 19]\n " shape="invhouse"] - 9 -> 3 ; + 9 -> 6 ; 8 [label="8: Prune (true branch) \n PRUNE((0 != 0), true); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="invhouse"] @@ -444,10 +444,10 @@ digraph iCFG { 7 -> 12 ; -3 [label="3: Return Stmt \n n$1=*&target:class A * [line 20]\n n$0=_fun_A_x(n$1:class A *) virtual [line 20]\n *&return:int =n$0 [line 20]\n REMOVE_TEMPS(n$0,n$1); [line 20]\n NULLIFY(&target,false); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="box"] +6 [label="6: Return Stmt \n n$1=*&target:class A * [line 20]\n n$0=_fun_A_x(n$1:class A *) virtual [line 20]\n *&return:int =n$0 [line 20]\n REMOVE_TEMPS(n$0,n$1); [line 20]\n NULLIFY(&target,false); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="box"] - 3 -> 2 ; + 6 -> 2 ; 2 [label="2: Exit A_addTarget: \n " color=yellow style=filled] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot b/infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot index 53a9737d6..f21e41917 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/BlockVar.dot @@ -1,27 +1,27 @@ digraph iCFG { -19 [label="19: DeclStmt \n *&error:class NSError *=0 [line 20]\n NULLIFY(&error,false); [line 20]\n " shape="box"] +19 [label="19: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_BlockVar_navigateToURLInBackground______1); [line 19]\n n$10=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_BlockVar_navigateToURLInBackground______1 ):unsigned long ) [line 19]\n *&__objc_anonymous_block_BlockVar_navigateToURLInBackground______1:class __objc_anonymous_block_BlockVar_navigateToURLInBackground______1 =n$10 [line 19]\n *&addBlock:_fn_ (*)=(_fun___objc_anonymous_block_BlockVar_navigateToURLInBackground______1) [line 19]\n REMOVE_TEMPS(n$10); [line 19]\n " shape="box"] - 19 -> 18 ; -18 [label="18: DeclStmt \n n$9=_fun_BlockVar_test() [line 21]\n *&res:int =n$9 [line 21]\n REMOVE_TEMPS(n$9); [line 21]\n " shape="box"] + 19 -> 13 ; +18 [label="18: DeclStmt \n *&error:class NSError *=0 [line 20]\n NULLIFY(&error,false); [line 20]\n " shape="box"] 18 -> 17 ; -17 [label="17: Return Stmt \n n$6=*&a:int [line 22]\n n$7=*&b:int [line 22]\n n$8=*&res:int [line 22]\n *&return:int =((n$6 + n$7) + n$8) [line 22]\n REMOVE_TEMPS(n$6,n$7,n$8); [line 22]\n NULLIFY(&a,false); [line 22]\n NULLIFY(&b,false); [line 22]\n NULLIFY(&res,false); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] +17 [label="17: DeclStmt \n n$9=_fun_BlockVar_test() [line 21]\n *&res:int =n$9 [line 21]\n REMOVE_TEMPS(n$9); [line 21]\n " shape="box"] 17 -> 16 ; -16 [label="16: Exit __objc_anonymous_block_BlockVar_navigateToURLInBackground______1 \n " color=yellow style=filled] +16 [label="16: Return Stmt \n n$6=*&a:int [line 22]\n n$7=*&b:int [line 22]\n n$8=*&res:int [line 22]\n *&return:int =((n$6 + n$7) + n$8) [line 22]\n REMOVE_TEMPS(n$6,n$7,n$8); [line 22]\n NULLIFY(&a,false); [line 22]\n NULLIFY(&b,false); [line 22]\n NULLIFY(&res,false); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] -15 [label="15: Start __objc_anonymous_block_BlockVar_navigateToURLInBackground______1\nFormals: a:int b:int \nLocals: res:int error:class NSError * \n DECLARE_LOCALS(&return,&res,&error); [line 19]\n NULLIFY(&error,false); [line 19]\n NULLIFY(&res,false); [line 19]\n " color=yellow style=filled] + 16 -> 15 ; +15 [label="15: Exit __objc_anonymous_block_BlockVar_navigateToURLInBackground______1 \n " color=yellow style=filled] - 15 -> 19 ; -14 [label="14: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_BlockVar_navigateToURLInBackground______1); [line 19]\n n$10=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_BlockVar_navigateToURLInBackground______1 ):unsigned long ) [line 19]\n *&__objc_anonymous_block_BlockVar_navigateToURLInBackground______1:class __objc_anonymous_block_BlockVar_navigateToURLInBackground______1 =n$10 [line 19]\n *&addBlock:_fn_ (*)=(_fun___objc_anonymous_block_BlockVar_navigateToURLInBackground______1) [line 19]\n REMOVE_TEMPS(n$10); [line 19]\n " shape="box"] +14 [label="14: Start __objc_anonymous_block_BlockVar_navigateToURLInBackground______1\nFormals: a:int b:int \nLocals: res:int error:class NSError * \n DECLARE_LOCALS(&return,&res,&error); [line 19]\n NULLIFY(&error,false); [line 19]\n NULLIFY(&res,false); [line 19]\n " color=yellow style=filled] - 14 -> 13 ; + 14 -> 18 ; 13 [label="13: DeclStmt \n n$4=*&addBlock:_fn_ (*) [line 24]\n n$5=n$4(1:int ,2:int ) [line 24]\n *&x:int =n$5 [line 24]\n REMOVE_TEMPS(n$4,n$5); [line 24]\n NULLIFY(&addBlock,false); [line 24]\n " shape="box"] @@ -61,7 +61,7 @@ digraph iCFG { 4 [label="4: Start BlockVar_navigateToURLInBackground\nFormals: \nLocals: p:int * x:int addBlock:_fn_ (*) \n DECLARE_LOCALS(&return,&p,&x,&addBlock); [line 18]\n NULLIFY(&addBlock,false); [line 18]\n NULLIFY(&p,false); [line 18]\n NULLIFY(&x,false); [line 18]\n " color=yellow style=filled] - 4 -> 14 ; + 4 -> 19 ; 3 [label="3: Return Stmt \n *&return:int =5 [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot b/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot index 7a5c921d5..1e45a7609 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/block-it.dot @@ -6,35 +6,35 @@ digraph iCFG { 51 [label="51: DeclStmt \n n$44=*&a:class NSArray * [line 32]\n *&objects:class NSArray *=n$44 [line 32]\n REMOVE_TEMPS(n$44); [line 32]\n NULLIFY(&a,false); [line 32]\n " shape="box"] - 51 -> 44 ; -50 [label="50: BinaryOperatorStmt: Assign \n NULLIFY(&ShouldStop,false); [line 40]\n n$42=*&stop:_Bool * [line 40]\n *n$42:_Bool =1 [line 40]\n REMOVE_TEMPS(n$42); [line 40]\n NULLIFY(&stop,false); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] + 51 -> 50 ; +50 [label="50: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_MyBlock_array_trans______2); [line 35]\n n$43=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_MyBlock_array_trans______2 ):unsigned long ) [line 35]\n *&__objc_anonymous_block_MyBlock_array_trans______2:class __objc_anonymous_block_MyBlock_array_trans______2 =n$43 [line 35]\n *&enumerateObjectsUsingBlock:_fn_ (*)=(_fun___objc_anonymous_block_MyBlock_array_trans______2) [line 35]\n REMOVE_TEMPS(n$43); [line 35]\n " shape="box"] - 50 -> 47 ; -49 [label="49: Prune (false branch) \n n$41=*&ShouldStop:int [line 39]\n PRUNE((n$41 == 0), false); [line 39]\n REMOVE_TEMPS(n$41); [line 39]\n APPLY_ABSTRACTION; [line 39]\n " shape="invhouse"] + 50 -> 43 ; +49 [label="49: BinaryOperatorStmt: Assign \n NULLIFY(&ShouldStop,false); [line 40]\n n$42=*&stop:_Bool * [line 40]\n *n$42:_Bool =1 [line 40]\n REMOVE_TEMPS(n$42); [line 40]\n NULLIFY(&stop,false); [line 40]\n APPLY_ABSTRACTION; [line 40]\n " shape="box"] - 49 -> 47 ; -48 [label="48: Prune (true branch) \n n$41=*&ShouldStop:int [line 39]\n PRUNE((n$41 != 0), true); [line 39]\n REMOVE_TEMPS(n$41); [line 39]\n " shape="invhouse"] + 49 -> 46 ; +48 [label="48: Prune (false branch) \n n$41=*&ShouldStop:int [line 39]\n PRUNE((n$41 == 0), false); [line 39]\n REMOVE_TEMPS(n$41); [line 39]\n APPLY_ABSTRACTION; [line 39]\n " shape="invhouse"] - 48 -> 50 ; -47 [label="47: + \n NULLIFY(&ShouldStop,false); [line 39]\n NULLIFY(&stop,false); [line 39]\n " ] + 48 -> 46 ; +47 [label="47: Prune (true branch) \n n$41=*&ShouldStop:int [line 39]\n PRUNE((n$41 != 0), true); [line 39]\n REMOVE_TEMPS(n$41); [line 39]\n " shape="invhouse"] - 47 -> 46 ; -46 [label="46: Exit __objc_anonymous_block_MyBlock_array_trans______2 \n " color=yellow style=filled] + 47 -> 49 ; +46 [label="46: + \n NULLIFY(&ShouldStop,false); [line 39]\n NULLIFY(&stop,false); [line 39]\n " ] -45 [label="45: Start __objc_anonymous_block_MyBlock_array_trans______2\nFormals: object:struct objc_object * idx:unsigned long stop:_Bool *\nLocals: ShouldStop:int \n DECLARE_LOCALS(&return,&ShouldStop); [line 35]\n NULLIFY(&idx,false); [line 35]\n NULLIFY(&object,false); [line 35]\n " color=yellow style=filled] + 46 -> 45 ; +45 [label="45: Exit __objc_anonymous_block_MyBlock_array_trans______2 \n " color=yellow style=filled] - 45 -> 48 ; - 45 -> 49 ; -44 [label="44: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_MyBlock_array_trans______2); [line 35]\n n$43=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_MyBlock_array_trans______2 ):unsigned long ) [line 35]\n *&__objc_anonymous_block_MyBlock_array_trans______2:class __objc_anonymous_block_MyBlock_array_trans______2 =n$43 [line 35]\n *&enumerateObjectsUsingBlock:_fn_ (*)=(_fun___objc_anonymous_block_MyBlock_array_trans______2) [line 35]\n REMOVE_TEMPS(n$43); [line 35]\n " shape="box"] +44 [label="44: Start __objc_anonymous_block_MyBlock_array_trans______2\nFormals: object:struct objc_object * idx:unsigned long stop:_Bool *\nLocals: ShouldStop:int \n DECLARE_LOCALS(&return,&ShouldStop); [line 35]\n NULLIFY(&idx,false); [line 35]\n NULLIFY(&object,false); [line 35]\n " color=yellow style=filled] - 44 -> 43 ; + 44 -> 47 ; + 44 -> 48 ; 43 [label="43: DeclStmt \n n$40=_fun_malloc_no_fail(sizeof(_Bool ):_Bool ) [line 43]\n *&stop:_Bool *=n$40 [line 43]\n REMOVE_TEMPS(n$40); [line 43]\n " shape="box"] @@ -111,35 +111,35 @@ digraph iCFG { 25 [label="25: DeclStmt \n n$21=*&a:class NSArray * [line 15]\n *&objects:class NSArray *=n$21 [line 15]\n REMOVE_TEMPS(n$21); [line 15]\n NULLIFY(&a,false); [line 15]\n " shape="box"] - 25 -> 18 ; -24 [label="24: BinaryOperatorStmt: Assign \n NULLIFY(&ShouldStop,false); [line 22]\n n$19=*&stop:_Bool * [line 22]\n *n$19:_Bool =1 [line 22]\n REMOVE_TEMPS(n$19); [line 22]\n NULLIFY(&stop,false); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] + 25 -> 24 ; +24 [label="24: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_MyBlock_array______1); [line 15]\n n$20=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_MyBlock_array______1 ):unsigned long ) [line 15]\n *&__objc_anonymous_block_MyBlock_array______1:class __objc_anonymous_block_MyBlock_array______1 =n$20 [line 15]\n *&infer___objc_anonymous_block_MyBlock_array______1:_fn_ (*)=(_fun___objc_anonymous_block_MyBlock_array______1) [line 15]\n REMOVE_TEMPS(n$20); [line 15]\n " shape="box"] - 24 -> 21 ; -23 [label="23: Prune (false branch) \n n$18=*&ShouldStop:int [line 20]\n PRUNE((n$18 == 0), false); [line 20]\n REMOVE_TEMPS(n$18); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="invhouse"] + 24 -> 17 ; +23 [label="23: BinaryOperatorStmt: Assign \n NULLIFY(&ShouldStop,false); [line 22]\n n$19=*&stop:_Bool * [line 22]\n *n$19:_Bool =1 [line 22]\n REMOVE_TEMPS(n$19); [line 22]\n NULLIFY(&stop,false); [line 22]\n APPLY_ABSTRACTION; [line 22]\n " shape="box"] - 23 -> 21 ; -22 [label="22: Prune (true branch) \n n$18=*&ShouldStop:int [line 20]\n PRUNE((n$18 != 0), true); [line 20]\n REMOVE_TEMPS(n$18); [line 20]\n " shape="invhouse"] + 23 -> 20 ; +22 [label="22: Prune (false branch) \n n$18=*&ShouldStop:int [line 20]\n PRUNE((n$18 == 0), false); [line 20]\n REMOVE_TEMPS(n$18); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="invhouse"] - 22 -> 24 ; -21 [label="21: + \n NULLIFY(&ShouldStop,false); [line 20]\n NULLIFY(&stop,false); [line 20]\n " ] + 22 -> 20 ; +21 [label="21: Prune (true branch) \n n$18=*&ShouldStop:int [line 20]\n PRUNE((n$18 != 0), true); [line 20]\n REMOVE_TEMPS(n$18); [line 20]\n " shape="invhouse"] - 21 -> 20 ; -20 [label="20: Exit __objc_anonymous_block_MyBlock_array______1 \n " color=yellow style=filled] + 21 -> 23 ; +20 [label="20: + \n NULLIFY(&ShouldStop,false); [line 20]\n NULLIFY(&stop,false); [line 20]\n " ] -19 [label="19: Start __objc_anonymous_block_MyBlock_array______1\nFormals: object:struct objc_object * idx:unsigned long stop:_Bool *\nLocals: ShouldStop:int \n DECLARE_LOCALS(&return,&ShouldStop); [line 15]\n NULLIFY(&idx,false); [line 15]\n NULLIFY(&object,false); [line 15]\n " color=yellow style=filled] + 20 -> 19 ; +19 [label="19: Exit __objc_anonymous_block_MyBlock_array______1 \n " color=yellow style=filled] - 19 -> 22 ; - 19 -> 23 ; -18 [label="18: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_MyBlock_array______1); [line 15]\n n$20=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_MyBlock_array______1 ):unsigned long ) [line 15]\n *&__objc_anonymous_block_MyBlock_array______1:class __objc_anonymous_block_MyBlock_array______1 =n$20 [line 15]\n *&infer___objc_anonymous_block_MyBlock_array______1:_fn_ (*)=(_fun___objc_anonymous_block_MyBlock_array______1) [line 15]\n REMOVE_TEMPS(n$20); [line 15]\n " shape="box"] +18 [label="18: Start __objc_anonymous_block_MyBlock_array______1\nFormals: object:struct objc_object * idx:unsigned long stop:_Bool *\nLocals: ShouldStop:int \n DECLARE_LOCALS(&return,&ShouldStop); [line 15]\n NULLIFY(&idx,false); [line 15]\n NULLIFY(&object,false); [line 15]\n " color=yellow style=filled] - 18 -> 17 ; + 18 -> 21 ; + 18 -> 22 ; 17 [label="17: DeclStmt \n n$17=_fun_malloc_no_fail(sizeof(signed char ):signed char ) [line 15]\n *&stop:_Bool *=n$17 [line 15]\n REMOVE_TEMPS(n$17); [line 15]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot index 078a6dded..2dc6353b8 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/dispatch.dot @@ -61,21 +61,21 @@ digraph iCFG { 17 -> 19 ; -16 [label="16: BinaryOperatorStmt: Assign \n n$12=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 37]\n n$10=_fun_A_init(n$12:class A *) virtual [line 37]\n *&#GB$A_trans_sharedInstance:struct objc_object *=n$10 [line 37]\n REMOVE_TEMPS(n$10,n$12); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] +16 [label="16: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_trans______2); [line 36]\n n$13=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_trans______2 ):unsigned long ) [line 36]\n *&__objc_anonymous_block_A_trans______2:class __objc_anonymous_block_A_trans______2 =n$13 [line 36]\n n$14=*&#GB$A_trans_sharedInstance:struct objc_object * [line 36]\n *n$13.A_trans_sharedInstance:struct objc_object *=n$14 [line 36]\n *&dummy_block:_fn_ (*)=(_fun___objc_anonymous_block_A_trans______2) [line 36]\n REMOVE_TEMPS(n$13,n$14); [line 36]\n " shape="box"] - 16 -> 15 ; -15 [label="15: Exit __objc_anonymous_block_A_trans______2 \n " color=yellow style=filled] + 16 -> 12 ; +15 [label="15: BinaryOperatorStmt: Assign \n n$12=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 37]\n n$10=_fun_A_init(n$12:class A *) virtual [line 37]\n *&#GB$A_trans_sharedInstance:struct objc_object *=n$10 [line 37]\n REMOVE_TEMPS(n$10,n$12); [line 37]\n APPLY_ABSTRACTION; [line 37]\n " shape="box"] -14 [label="14: Start __objc_anonymous_block_A_trans______2\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 36]\n " color=yellow style=filled] + 15 -> 14 ; +14 [label="14: Exit __objc_anonymous_block_A_trans______2 \n " color=yellow style=filled] - 14 -> 16 ; -13 [label="13: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_trans______2); [line 36]\n n$13=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_trans______2 ):unsigned long ) [line 36]\n *&__objc_anonymous_block_A_trans______2:class __objc_anonymous_block_A_trans______2 =n$13 [line 36]\n n$14=*&#GB$A_trans_sharedInstance:struct objc_object * [line 36]\n *n$13.A_trans_sharedInstance:struct objc_object *=n$14 [line 36]\n *&dummy_block:_fn_ (*)=(_fun___objc_anonymous_block_A_trans______2) [line 36]\n REMOVE_TEMPS(n$13,n$14); [line 36]\n " shape="box"] +13 [label="13: Start __objc_anonymous_block_A_trans______2\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 36]\n " color=yellow style=filled] - 13 -> 12 ; + 13 -> 15 ; 12 [label="12: Call n$9 \n n$9=*&dummy_block:_fn_ (*) [line 39]\n n$9() [line 39]\n REMOVE_TEMPS(n$9); [line 39]\n NULLIFY(&dummy_block,false); [line 39]\n " shape="box"] @@ -90,22 +90,22 @@ digraph iCFG { 9 [label="9: Start A_trans\nFormals: \nLocals: dummy_block:_fn_ (*) \n DECLARE_LOCALS(&return,&dummy_block); [line 33]\n NULLIFY(&dummy_block,false); [line 33]\n " color=yellow style=filled] - 9 -> 13 ; -8 [label="8: BinaryOperatorStmt: Assign \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 28]\n n$3=_fun_A_init(n$5:class A *) virtual [line 28]\n *&#GB$A_sharedInstance_sharedInstance:struct objc_object *=n$3 [line 28]\n REMOVE_TEMPS(n$3,n$5); [line 28]\n APPLY_ABSTRACTION; [line 28]\n " shape="box"] + 9 -> 16 ; +8 [label="8: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_sharedInstance______1); [line 27]\n n$6=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_sharedInstance______1 ):unsigned long ) [line 27]\n *&__objc_anonymous_block_A_sharedInstance______1:class __objc_anonymous_block_A_sharedInstance______1 =n$6 [line 27]\n n$7=*&#GB$A_sharedInstance_sharedInstance:struct objc_object * [line 27]\n *n$6.A_sharedInstance_sharedInstance:struct objc_object *=n$7 [line 27]\n *&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*)=(_fun___objc_anonymous_block_A_sharedInstance______1) [line 29]\n REMOVE_TEMPS(n$6,n$7); [line 29]\n " shape="box"] - 8 -> 7 ; -7 [label="7: Exit __objc_anonymous_block_A_sharedInstance______1 \n " color=yellow style=filled] + 8 -> 4 ; +7 [label="7: BinaryOperatorStmt: Assign \n n$5=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 28]\n n$3=_fun_A_init(n$5:class A *) virtual [line 28]\n *&#GB$A_sharedInstance_sharedInstance:struct objc_object *=n$3 [line 28]\n REMOVE_TEMPS(n$3,n$5); [line 28]\n APPLY_ABSTRACTION; [line 28]\n " shape="box"] -6 [label="6: Start __objc_anonymous_block_A_sharedInstance______1\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled] + 7 -> 6 ; +6 [label="6: Exit __objc_anonymous_block_A_sharedInstance______1 \n " color=yellow style=filled] - 6 -> 8 ; -5 [label="5: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_sharedInstance______1); [line 27]\n n$6=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_sharedInstance______1 ):unsigned long ) [line 27]\n *&__objc_anonymous_block_A_sharedInstance______1:class __objc_anonymous_block_A_sharedInstance______1 =n$6 [line 27]\n n$7=*&#GB$A_sharedInstance_sharedInstance:struct objc_object * [line 27]\n *n$6.A_sharedInstance_sharedInstance:struct objc_object *=n$7 [line 27]\n *&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*)=(_fun___objc_anonymous_block_A_sharedInstance______1) [line 29]\n REMOVE_TEMPS(n$6,n$7); [line 29]\n " shape="box"] +5 [label="5: Start __objc_anonymous_block_A_sharedInstance______1\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 27]\n " color=yellow style=filled] - 5 -> 4 ; + 5 -> 7 ; 4 [label="4: Call n$1 \n n$1=*&infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*) [line 29]\n n$2=n$1() [line 29]\n REMOVE_TEMPS(n$1,n$2); [line 29]\n NULLIFY(&infer___objc_anonymous_block_A_sharedInstance______1,false); [line 29]\n " shape="box"] @@ -120,5 +120,5 @@ digraph iCFG { 1 [label="1: Start A_sharedInstance\nFormals: \nLocals: infer___objc_anonymous_block_A_sharedInstance______1:_fn_ (*) \n DECLARE_LOCALS(&return,&infer___objc_anonymous_block_A_sharedInstance______1); [line 23]\n NULLIFY(&infer___objc_anonymous_block_A_sharedInstance______1,false); [line 23]\n " color=yellow style=filled] - 1 -> 5 ; + 1 -> 8 ; } diff --git a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot index 0b4110bda..d53e3eb91 100644 --- a/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot +++ b/infer/tests/codetoanalyze/objc/frontend/block/dispatch_examples.dot @@ -2,26 +2,26 @@ digraph iCFG { 60 [label="60: DeclStmt \n *&#GB$A_dispatch_barrier_example_a:class A *=0 [line 69]\n " shape="box"] - 60 -> 55 ; -59 [label="59: BinaryOperatorStmt: Assign \n n$57=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 71]\n n$55=_fun_NSObject_init(n$57:class A *) virtual [line 71]\n *&#GB$A_dispatch_barrier_example_a:class A *=n$55 [line 71]\n REMOVE_TEMPS(n$55,n$57); [line 71]\n " shape="box"] + 60 -> 59 ; +59 [label="59: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_barrier_example______6); [line 70]\n n$58=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_barrier_example______6 ):unsigned long ) [line 70]\n *&__objc_anonymous_block_A_dispatch_barrier_example______6:class __objc_anonymous_block_A_dispatch_barrier_example______6 =n$58 [line 70]\n n$59=*&#GB$A_dispatch_barrier_example_a:class A * [line 70]\n *n$58.A_dispatch_barrier_example_a:class A *=n$59 [line 70]\n *&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_barrier_example______6) [line 70]\n REMOVE_TEMPS(n$58,n$59); [line 70]\n " shape="box"] - 59 -> 58 ; -58 [label="58: BinaryOperatorStmt: Assign \n n$54=*&#GB$A_dispatch_barrier_example_a:class A * [line 72]\n *n$54.x:int =10 [line 72]\n REMOVE_TEMPS(n$54); [line 72]\n APPLY_ABSTRACTION; [line 72]\n " shape="box"] + 59 -> 54 ; +58 [label="58: BinaryOperatorStmt: Assign \n n$57=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 71]\n n$55=_fun_NSObject_init(n$57:class A *) virtual [line 71]\n *&#GB$A_dispatch_barrier_example_a:class A *=n$55 [line 71]\n REMOVE_TEMPS(n$55,n$57); [line 71]\n " shape="box"] 58 -> 57 ; -57 [label="57: Exit __objc_anonymous_block_A_dispatch_barrier_example______6 \n " color=yellow style=filled] +57 [label="57: BinaryOperatorStmt: Assign \n n$54=*&#GB$A_dispatch_barrier_example_a:class A * [line 72]\n *n$54.x:int =10 [line 72]\n REMOVE_TEMPS(n$54); [line 72]\n APPLY_ABSTRACTION; [line 72]\n " shape="box"] -56 [label="56: Start __objc_anonymous_block_A_dispatch_barrier_example______6\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 70]\n " color=yellow style=filled] + 57 -> 56 ; +56 [label="56: Exit __objc_anonymous_block_A_dispatch_barrier_example______6 \n " color=yellow style=filled] - 56 -> 59 ; -55 [label="55: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_barrier_example______6); [line 70]\n n$58=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_barrier_example______6 ):unsigned long ) [line 70]\n *&__objc_anonymous_block_A_dispatch_barrier_example______6:class __objc_anonymous_block_A_dispatch_barrier_example______6 =n$58 [line 70]\n n$59=*&#GB$A_dispatch_barrier_example_a:class A * [line 70]\n *n$58.A_dispatch_barrier_example_a:class A *=n$59 [line 70]\n *&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_barrier_example______6) [line 70]\n REMOVE_TEMPS(n$58,n$59); [line 70]\n " shape="box"] +55 [label="55: Start __objc_anonymous_block_A_dispatch_barrier_example______6\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 70]\n " color=yellow style=filled] - 55 -> 54 ; + 55 -> 58 ; 54 [label="54: Call n$52 \n n$52=*&infer___objc_anonymous_block_A_dispatch_barrier_example______6:_fn_ (*) [line 70]\n n$53=n$52() [line 70]\n REMOVE_TEMPS(n$52,n$53); [line 70]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_barrier_example______6,false); [line 70]\n " shape="box"] @@ -40,26 +40,26 @@ digraph iCFG { 50 [label="50: DeclStmt \n *&#GB$A_dispatch_group_notify_example_a:class A *=0 [line 60]\n " shape="box"] - 50 -> 45 ; -49 [label="49: BinaryOperatorStmt: Assign \n n$47=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 62]\n n$45=_fun_NSObject_init(n$47:class A *) virtual [line 62]\n *&#GB$A_dispatch_group_notify_example_a:class A *=n$45 [line 62]\n REMOVE_TEMPS(n$45,n$47); [line 62]\n " shape="box"] + 50 -> 49 ; +49 [label="49: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_notify_example______5); [line 61]\n n$48=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_notify_example______5 ):unsigned long ) [line 61]\n *&__objc_anonymous_block_A_dispatch_group_notify_example______5:class __objc_anonymous_block_A_dispatch_group_notify_example______5 =n$48 [line 61]\n n$49=*&#GB$A_dispatch_group_notify_example_a:class A * [line 61]\n *n$48.A_dispatch_group_notify_example_a:class A *=n$49 [line 61]\n *&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_notify_example______5) [line 61]\n REMOVE_TEMPS(n$48,n$49); [line 61]\n " shape="box"] - 49 -> 48 ; -48 [label="48: BinaryOperatorStmt: Assign \n n$44=*&#GB$A_dispatch_group_notify_example_a:class A * [line 63]\n *n$44.x:int =10 [line 63]\n REMOVE_TEMPS(n$44); [line 63]\n APPLY_ABSTRACTION; [line 63]\n " shape="box"] + 49 -> 44 ; +48 [label="48: BinaryOperatorStmt: Assign \n n$47=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 62]\n n$45=_fun_NSObject_init(n$47:class A *) virtual [line 62]\n *&#GB$A_dispatch_group_notify_example_a:class A *=n$45 [line 62]\n REMOVE_TEMPS(n$45,n$47); [line 62]\n " shape="box"] 48 -> 47 ; -47 [label="47: Exit __objc_anonymous_block_A_dispatch_group_notify_example______5 \n " color=yellow style=filled] +47 [label="47: BinaryOperatorStmt: Assign \n n$44=*&#GB$A_dispatch_group_notify_example_a:class A * [line 63]\n *n$44.x:int =10 [line 63]\n REMOVE_TEMPS(n$44); [line 63]\n APPLY_ABSTRACTION; [line 63]\n " shape="box"] -46 [label="46: Start __objc_anonymous_block_A_dispatch_group_notify_example______5\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 61]\n " color=yellow style=filled] + 47 -> 46 ; +46 [label="46: Exit __objc_anonymous_block_A_dispatch_group_notify_example______5 \n " color=yellow style=filled] - 46 -> 49 ; -45 [label="45: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_notify_example______5); [line 61]\n n$48=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_notify_example______5 ):unsigned long ) [line 61]\n *&__objc_anonymous_block_A_dispatch_group_notify_example______5:class __objc_anonymous_block_A_dispatch_group_notify_example______5 =n$48 [line 61]\n n$49=*&#GB$A_dispatch_group_notify_example_a:class A * [line 61]\n *n$48.A_dispatch_group_notify_example_a:class A *=n$49 [line 61]\n *&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_notify_example______5) [line 61]\n REMOVE_TEMPS(n$48,n$49); [line 61]\n " shape="box"] +45 [label="45: Start __objc_anonymous_block_A_dispatch_group_notify_example______5\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 61]\n " color=yellow style=filled] - 45 -> 44 ; + 45 -> 48 ; 44 [label="44: Call n$42 \n n$42=*&infer___objc_anonymous_block_A_dispatch_group_notify_example______5:_fn_ (*) [line 61]\n n$43=n$42() [line 61]\n REMOVE_TEMPS(n$42,n$43); [line 61]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_group_notify_example______5,false); [line 61]\n " shape="box"] @@ -78,26 +78,26 @@ digraph iCFG { 40 [label="40: DeclStmt \n *&#GB$A_dispatch_group_example_a:class A *=0 [line 51]\n " shape="box"] - 40 -> 35 ; -39 [label="39: BinaryOperatorStmt: Assign \n n$37=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 53]\n n$35=_fun_NSObject_init(n$37:class A *) virtual [line 53]\n *&#GB$A_dispatch_group_example_a:class A *=n$35 [line 53]\n REMOVE_TEMPS(n$35,n$37); [line 53]\n " shape="box"] + 40 -> 39 ; +39 [label="39: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_example______4); [line 52]\n n$38=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_example______4 ):unsigned long ) [line 52]\n *&__objc_anonymous_block_A_dispatch_group_example______4:class __objc_anonymous_block_A_dispatch_group_example______4 =n$38 [line 52]\n n$39=*&#GB$A_dispatch_group_example_a:class A * [line 52]\n *n$38.A_dispatch_group_example_a:class A *=n$39 [line 52]\n *&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_example______4) [line 52]\n REMOVE_TEMPS(n$38,n$39); [line 52]\n " shape="box"] - 39 -> 38 ; -38 [label="38: BinaryOperatorStmt: Assign \n n$34=*&#GB$A_dispatch_group_example_a:class A * [line 54]\n *n$34.x:int =10 [line 54]\n REMOVE_TEMPS(n$34); [line 54]\n APPLY_ABSTRACTION; [line 54]\n " shape="box"] + 39 -> 34 ; +38 [label="38: BinaryOperatorStmt: Assign \n n$37=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 53]\n n$35=_fun_NSObject_init(n$37:class A *) virtual [line 53]\n *&#GB$A_dispatch_group_example_a:class A *=n$35 [line 53]\n REMOVE_TEMPS(n$35,n$37); [line 53]\n " shape="box"] 38 -> 37 ; -37 [label="37: Exit __objc_anonymous_block_A_dispatch_group_example______4 \n " color=yellow style=filled] +37 [label="37: BinaryOperatorStmt: Assign \n n$34=*&#GB$A_dispatch_group_example_a:class A * [line 54]\n *n$34.x:int =10 [line 54]\n REMOVE_TEMPS(n$34); [line 54]\n APPLY_ABSTRACTION; [line 54]\n " shape="box"] -36 [label="36: Start __objc_anonymous_block_A_dispatch_group_example______4\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 52]\n " color=yellow style=filled] + 37 -> 36 ; +36 [label="36: Exit __objc_anonymous_block_A_dispatch_group_example______4 \n " color=yellow style=filled] - 36 -> 39 ; -35 [label="35: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_group_example______4); [line 52]\n n$38=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_group_example______4 ):unsigned long ) [line 52]\n *&__objc_anonymous_block_A_dispatch_group_example______4:class __objc_anonymous_block_A_dispatch_group_example______4 =n$38 [line 52]\n n$39=*&#GB$A_dispatch_group_example_a:class A * [line 52]\n *n$38.A_dispatch_group_example_a:class A *=n$39 [line 52]\n *&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_group_example______4) [line 52]\n REMOVE_TEMPS(n$38,n$39); [line 52]\n " shape="box"] +35 [label="35: Start __objc_anonymous_block_A_dispatch_group_example______4\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 52]\n " color=yellow style=filled] - 35 -> 34 ; + 35 -> 38 ; 34 [label="34: Call n$32 \n n$32=*&infer___objc_anonymous_block_A_dispatch_group_example______4:_fn_ (*) [line 52]\n n$33=n$32() [line 52]\n REMOVE_TEMPS(n$32,n$33); [line 52]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_group_example______4,false); [line 52]\n " shape="box"] @@ -116,26 +116,26 @@ digraph iCFG { 30 [label="30: DeclStmt \n *&#GB$A_dispatch_after_example_a:class A *=0 [line 41]\n " shape="box"] - 30 -> 25 ; -29 [label="29: BinaryOperatorStmt: Assign \n n$27=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 44]\n n$25=_fun_NSObject_init(n$27:class A *) virtual [line 44]\n *&#GB$A_dispatch_after_example_a:class A *=n$25 [line 44]\n REMOVE_TEMPS(n$25,n$27); [line 44]\n " shape="box"] + 30 -> 29 ; +29 [label="29: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_after_example______3); [line 43]\n n$28=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_after_example______3 ):unsigned long ) [line 43]\n *&__objc_anonymous_block_A_dispatch_after_example______3:class __objc_anonymous_block_A_dispatch_after_example______3 =n$28 [line 43]\n n$29=*&#GB$A_dispatch_after_example_a:class A * [line 43]\n *n$28.A_dispatch_after_example_a:class A *=n$29 [line 43]\n *&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_after_example______3) [line 42]\n REMOVE_TEMPS(n$28,n$29); [line 42]\n " shape="box"] - 29 -> 28 ; -28 [label="28: BinaryOperatorStmt: Assign \n n$24=*&#GB$A_dispatch_after_example_a:class A * [line 45]\n *n$24.x:int =10 [line 45]\n REMOVE_TEMPS(n$24); [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] + 29 -> 24 ; +28 [label="28: BinaryOperatorStmt: Assign \n n$27=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 44]\n n$25=_fun_NSObject_init(n$27:class A *) virtual [line 44]\n *&#GB$A_dispatch_after_example_a:class A *=n$25 [line 44]\n REMOVE_TEMPS(n$25,n$27); [line 44]\n " shape="box"] 28 -> 27 ; -27 [label="27: Exit __objc_anonymous_block_A_dispatch_after_example______3 \n " color=yellow style=filled] +27 [label="27: BinaryOperatorStmt: Assign \n n$24=*&#GB$A_dispatch_after_example_a:class A * [line 45]\n *n$24.x:int =10 [line 45]\n REMOVE_TEMPS(n$24); [line 45]\n APPLY_ABSTRACTION; [line 45]\n " shape="box"] -26 [label="26: Start __objc_anonymous_block_A_dispatch_after_example______3\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 43]\n " color=yellow style=filled] + 27 -> 26 ; +26 [label="26: Exit __objc_anonymous_block_A_dispatch_after_example______3 \n " color=yellow style=filled] - 26 -> 29 ; -25 [label="25: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_after_example______3); [line 43]\n n$28=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_after_example______3 ):unsigned long ) [line 43]\n *&__objc_anonymous_block_A_dispatch_after_example______3:class __objc_anonymous_block_A_dispatch_after_example______3 =n$28 [line 43]\n n$29=*&#GB$A_dispatch_after_example_a:class A * [line 43]\n *n$28.A_dispatch_after_example_a:class A *=n$29 [line 43]\n *&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_after_example______3) [line 42]\n REMOVE_TEMPS(n$28,n$29); [line 42]\n " shape="box"] +25 [label="25: Start __objc_anonymous_block_A_dispatch_after_example______3\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 43]\n " color=yellow style=filled] - 25 -> 24 ; + 25 -> 28 ; 24 [label="24: Call n$22 \n n$22=*&infer___objc_anonymous_block_A_dispatch_after_example______3:_fn_ (*) [line 42]\n n$23=n$22() [line 42]\n REMOVE_TEMPS(n$22,n$23); [line 42]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_after_example______3,false); [line 42]\n " shape="box"] @@ -154,26 +154,26 @@ digraph iCFG { 20 [label="20: DeclStmt \n *&#GB$A_dispatch_async_example_a:class A *=0 [line 32]\n " shape="box"] - 20 -> 15 ; -19 [label="19: BinaryOperatorStmt: Assign \n n$17=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 34]\n n$15=_fun_NSObject_init(n$17:class A *) virtual [line 34]\n *&#GB$A_dispatch_async_example_a:class A *=n$15 [line 34]\n REMOVE_TEMPS(n$15,n$17); [line 34]\n " shape="box"] + 20 -> 19 ; +19 [label="19: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_async_example______2); [line 33]\n n$18=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_async_example______2 ):unsigned long ) [line 33]\n *&__objc_anonymous_block_A_dispatch_async_example______2:class __objc_anonymous_block_A_dispatch_async_example______2 =n$18 [line 33]\n n$19=*&#GB$A_dispatch_async_example_a:class A * [line 33]\n *n$18.A_dispatch_async_example_a:class A *=n$19 [line 33]\n *&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_async_example______2) [line 33]\n REMOVE_TEMPS(n$18,n$19); [line 33]\n " shape="box"] - 19 -> 18 ; -18 [label="18: BinaryOperatorStmt: Assign \n n$14=*&#GB$A_dispatch_async_example_a:class A * [line 35]\n *n$14.x:int =10 [line 35]\n REMOVE_TEMPS(n$14); [line 35]\n APPLY_ABSTRACTION; [line 35]\n " shape="box"] + 19 -> 14 ; +18 [label="18: BinaryOperatorStmt: Assign \n n$17=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 34]\n n$15=_fun_NSObject_init(n$17:class A *) virtual [line 34]\n *&#GB$A_dispatch_async_example_a:class A *=n$15 [line 34]\n REMOVE_TEMPS(n$15,n$17); [line 34]\n " shape="box"] 18 -> 17 ; -17 [label="17: Exit __objc_anonymous_block_A_dispatch_async_example______2 \n " color=yellow style=filled] +17 [label="17: BinaryOperatorStmt: Assign \n n$14=*&#GB$A_dispatch_async_example_a:class A * [line 35]\n *n$14.x:int =10 [line 35]\n REMOVE_TEMPS(n$14); [line 35]\n APPLY_ABSTRACTION; [line 35]\n " shape="box"] -16 [label="16: Start __objc_anonymous_block_A_dispatch_async_example______2\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 33]\n " color=yellow style=filled] + 17 -> 16 ; +16 [label="16: Exit __objc_anonymous_block_A_dispatch_async_example______2 \n " color=yellow style=filled] - 16 -> 19 ; -15 [label="15: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_async_example______2); [line 33]\n n$18=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_async_example______2 ):unsigned long ) [line 33]\n *&__objc_anonymous_block_A_dispatch_async_example______2:class __objc_anonymous_block_A_dispatch_async_example______2 =n$18 [line 33]\n n$19=*&#GB$A_dispatch_async_example_a:class A * [line 33]\n *n$18.A_dispatch_async_example_a:class A *=n$19 [line 33]\n *&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_async_example______2) [line 33]\n REMOVE_TEMPS(n$18,n$19); [line 33]\n " shape="box"] +15 [label="15: Start __objc_anonymous_block_A_dispatch_async_example______2\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 33]\n " color=yellow style=filled] - 15 -> 14 ; + 15 -> 18 ; 14 [label="14: Call n$12 \n n$12=*&infer___objc_anonymous_block_A_dispatch_async_example______2:_fn_ (*) [line 33]\n n$13=n$12() [line 33]\n REMOVE_TEMPS(n$12,n$13); [line 33]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_async_example______2,false); [line 33]\n " shape="box"] @@ -192,26 +192,26 @@ digraph iCFG { 10 [label="10: DeclStmt \n *&#GB$A_dispatch_once_example_a:class A *=0 [line 21]\n " shape="box"] - 10 -> 5 ; -9 [label="9: BinaryOperatorStmt: Assign \n n$7=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 25]\n n$5=_fun_NSObject_init(n$7:class A *) virtual [line 25]\n *&#GB$A_dispatch_once_example_a:class A *=n$5 [line 25]\n REMOVE_TEMPS(n$5,n$7); [line 25]\n " shape="box"] + 10 -> 9 ; +9 [label="9: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_once_example______1); [line 24]\n n$8=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_once_example______1 ):unsigned long ) [line 24]\n *&__objc_anonymous_block_A_dispatch_once_example______1:class __objc_anonymous_block_A_dispatch_once_example______1 =n$8 [line 24]\n n$9=*&#GB$A_dispatch_once_example_a:class A * [line 24]\n *n$8.A_dispatch_once_example_a:class A *=n$9 [line 24]\n *&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_once_example______1) [line 23]\n REMOVE_TEMPS(n$8,n$9); [line 23]\n " shape="box"] - 9 -> 8 ; -8 [label="8: BinaryOperatorStmt: Assign \n n$4=*&#GB$A_dispatch_once_example_a:class A * [line 26]\n *n$4.x:int =10 [line 26]\n REMOVE_TEMPS(n$4); [line 26]\n APPLY_ABSTRACTION; [line 26]\n " shape="box"] + 9 -> 4 ; +8 [label="8: BinaryOperatorStmt: Assign \n n$7=_fun___objc_alloc_no_fail(sizeof(class A ):unsigned long ) [line 25]\n n$5=_fun_NSObject_init(n$7:class A *) virtual [line 25]\n *&#GB$A_dispatch_once_example_a:class A *=n$5 [line 25]\n REMOVE_TEMPS(n$5,n$7); [line 25]\n " shape="box"] 8 -> 7 ; -7 [label="7: Exit __objc_anonymous_block_A_dispatch_once_example______1 \n " color=yellow style=filled] +7 [label="7: BinaryOperatorStmt: Assign \n n$4=*&#GB$A_dispatch_once_example_a:class A * [line 26]\n *n$4.x:int =10 [line 26]\n REMOVE_TEMPS(n$4); [line 26]\n APPLY_ABSTRACTION; [line 26]\n " shape="box"] -6 [label="6: Start __objc_anonymous_block_A_dispatch_once_example______1\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] + 7 -> 6 ; +6 [label="6: Exit __objc_anonymous_block_A_dispatch_once_example______1 \n " color=yellow style=filled] - 6 -> 9 ; -5 [label="5: DeclStmt \n DECLARE_LOCALS(&__objc_anonymous_block_A_dispatch_once_example______1); [line 24]\n n$8=_fun___objc_alloc_no_fail(sizeof(class __objc_anonymous_block_A_dispatch_once_example______1 ):unsigned long ) [line 24]\n *&__objc_anonymous_block_A_dispatch_once_example______1:class __objc_anonymous_block_A_dispatch_once_example______1 =n$8 [line 24]\n n$9=*&#GB$A_dispatch_once_example_a:class A * [line 24]\n *n$8.A_dispatch_once_example_a:class A *=n$9 [line 24]\n *&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*)=(_fun___objc_anonymous_block_A_dispatch_once_example______1) [line 23]\n REMOVE_TEMPS(n$8,n$9); [line 23]\n " shape="box"] +5 [label="5: Start __objc_anonymous_block_A_dispatch_once_example______1\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 24]\n " color=yellow style=filled] - 5 -> 4 ; + 5 -> 8 ; 4 [label="4: Call n$2 \n n$2=*&infer___objc_anonymous_block_A_dispatch_once_example______1:_fn_ (*) [line 23]\n n$3=n$2() [line 23]\n REMOVE_TEMPS(n$2,n$3); [line 23]\n NULLIFY(&infer___objc_anonymous_block_A_dispatch_once_example______1,false); [line 23]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot index 76768317f..f73847720 100644 --- a/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot +++ b/infer/tests/codetoanalyze/objc/frontend/conditional_operation/ConditionalOperation.dot @@ -1,36 +1,36 @@ digraph iCFG { -11 [label="11: ConditinalStmt Branch \n NULLIFY(&b,false); [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___7); [line 24]\n *&SIL_temp_conditional___7:int =1 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] +11 [label="11: Return Stmt \n n$2=*&self:class A * [line 24]\n n$5=*&SIL_temp_conditional___6:int [line 24]\n NULLIFY(&SIL_temp_conditional___6,true); [line 24]\n n$1=_fun_A_test4:(n$2:class A *,n$5:int ) virtual [line 24]\n *&return:int =n$1 [line 24]\n REMOVE_TEMPS(n$1,n$2,n$5); [line 24]\n NULLIFY(&self,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 11 -> 7 ; -10 [label="10: ConditinalStmt Branch \n n$4=*&b:_Bool [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___7); [line 24]\n *&SIL_temp_conditional___7:int =n$4 [line 24]\n REMOVE_TEMPS(n$4); [line 24]\n NULLIFY(&b,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] + 11 -> 5 ; +10 [label="10: ConditinalStmt Branch \n NULLIFY(&b,false); [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___6); [line 24]\n *&SIL_temp_conditional___6:int =1 [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 10 -> 7 ; -9 [label="9: Prune (false branch) \n n$3=*&b:_Bool [line 24]\n PRUNE((n$3 == 0), false); [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n " shape="invhouse"] + 10 -> 6 ; +9 [label="9: ConditinalStmt Branch \n n$4=*&b:_Bool [line 24]\n DECLARE_LOCALS(&SIL_temp_conditional___6); [line 24]\n *&SIL_temp_conditional___6:int =n$4 [line 24]\n REMOVE_TEMPS(n$4); [line 24]\n NULLIFY(&b,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] - 9 -> 11 ; -8 [label="8: Prune (true branch) \n n$3=*&b:_Bool [line 24]\n PRUNE((n$3 != 0), true); [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n " shape="invhouse"] + 9 -> 6 ; +8 [label="8: Prune (false branch) \n n$3=*&b:_Bool [line 24]\n PRUNE((n$3 == 0), false); [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n " shape="invhouse"] 8 -> 10 ; -7 [label="7: + \n " ] +7 [label="7: Prune (true branch) \n n$3=*&b:_Bool [line 24]\n PRUNE((n$3 != 0), true); [line 24]\n REMOVE_TEMPS(n$3); [line 24]\n " shape="invhouse"] - 7 -> 6 ; -6 [label="6: Return Stmt \n n$2=*&self:class A * [line 24]\n n$5=*&SIL_temp_conditional___7:int [line 24]\n NULLIFY(&SIL_temp_conditional___7,true); [line 24]\n n$1=_fun_A_test4:(n$2:class A *,n$5:int ) virtual [line 24]\n *&return:int =n$1 [line 24]\n REMOVE_TEMPS(n$1,n$2,n$5); [line 24]\n NULLIFY(&self,false); [line 24]\n APPLY_ABSTRACTION; [line 24]\n " shape="box"] + 7 -> 9 ; +6 [label="6: + \n " ] - 6 -> 5 ; + 6 -> 11 ; 5 [label="5: Exit A_test5: \n " color=yellow style=filled] 4 [label="4: Start A_test5:\nFormals: self:class A * b:_Bool \nLocals: \n DECLARE_LOCALS(&return); [line 23]\n " color=yellow style=filled] + 4 -> 7 ; 4 -> 8 ; - 4 -> 9 ; 3 [label="3: Return Stmt \n n$0=*&x:int [line 20]\n *&return:int =n$0 [line 20]\n REMOVE_TEMPS(n$0); [line 20]\n NULLIFY(&x,false); [line 20]\n APPLY_ABSTRACTION; [line 20]\n " shape="box"] diff --git a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot index 6d4df21ed..e87a34a1b 100644 --- a/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot +++ b/infer/tests/codetoanalyze/objc/frontend/property/Property_getter.dot @@ -21,15 +21,15 @@ digraph iCFG { 7 -> 9 ; -3 [label="3: Return Stmt \n n$1=*&target:class A * [line 19]\n n$0=_fun_A_x(n$1:class A *) virtual [line 19]\n *&return:int =n$0 [line 19]\n REMOVE_TEMPS(n$0,n$1); [line 19]\n NULLIFY(&target,false); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] +6 [label="6: Return Stmt \n n$1=*&target:class A * [line 19]\n n$0=_fun_A_x(n$1:class A *) virtual [line 19]\n *&return:int =n$0 [line 19]\n REMOVE_TEMPS(n$0,n$1); [line 19]\n NULLIFY(&target,false); [line 19]\n APPLY_ABSTRACTION; [line 19]\n " shape="box"] - 3 -> 2 ; + 6 -> 2 ; 2 [label="2: Exit A_addTarget: \n " color=yellow style=filled] 1 [label="1: Start A_addTarget:\nFormals: self:class A * target:class A *\nLocals: \n DECLARE_LOCALS(&return); [line 18]\n NULLIFY(&self,false); [line 18]\n " color=yellow style=filled] - 1 -> 3 ; + 1 -> 6 ; }