Summary: When the body of the loop doesn't created a node then they don't get wired correctly to the rest of the loop and end up dangling. Force node creation to fix that. Fixes https://github.com/facebook/infer/issues/1373 Reviewed By: ezgicicek Differential Revision: D25804185 fbshipit-source-id: 85108bdd9master
parent
ad45bbe28d
commit
2ac2f019df
@ -1,47 +1,87 @@
|
|||||||
/* @generated */
|
/* @generated */
|
||||||
digraph cfg {
|
digraph cfg {
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_1" [label="1: Start main\nFormals: \nLocals: i:int j:int \n " color=yellow style=filled]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_1" [label="1: Start for_loop_no_brackets\nFormals: \nLocals: i:int j:int \n " color=yellow style=filled]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_1" -> "main.fad58de7366495db4650cfefac2fcd61_11" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_1" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_10" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_2" [label="2: Exit main \n " color=yellow style=filled]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_2" [label="2: Exit for_loop_no_brackets \n " color=yellow style=filled]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: Return Stmt \n *&return:int=0 [line 13, column 3]\n " shape="box"]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_3" [label="3: + \n " ]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_3" -> "main.fad58de7366495db4650cfefac2fcd61_2" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_3" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_6" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_4" [label="4: + \n " ]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_4" [label="4: DeclStmt \n VARIABLE_DECLARED(i:int); [line 18, column 8]\n *&i:int=0 [line 18, column 8]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_4" -> "main.fad58de7366495db4650cfefac2fcd61_7" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_4" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_3" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_5" [label="5: DeclStmt \n VARIABLE_DECLARED(i:int); [line 10, column 8]\n *&i:int=0 [line 10, column 8]\n " shape="box"]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_5" [label="5: UnaryOperator \n n$0=*&i:int [line 18, column 26]\n *&i:int=(n$0 + 1) [line 18, column 26]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_5" -> "main.fad58de7366495db4650cfefac2fcd61_4" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_5" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_3" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_6" [label="6: UnaryOperator \n n$0=*&i:int [line 10, column 27]\n *&i:int=(n$0 + 1) [line 10, column 27]\n " shape="box"]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_6" [label="6: BinaryOperatorStmt: LT \n n$1=*&i:int [line 18, column 19]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_6" -> "main.fad58de7366495db4650cfefac2fcd61_4" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_6" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_7" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_7" [label="7: BinaryOperatorStmt: LT \n n$1=*&i:int [line 10, column 19]\n " shape="box"]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_6" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_8" ;
|
||||||
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_7" [label="7: Prune (true branch, for loop) \n PRUNE((n$1 < 1), true); [line 18, column 19]\n " shape="invhouse"]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_7" -> "main.fad58de7366495db4650cfefac2fcd61_8" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_7" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_9" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_7" -> "main.fad58de7366495db4650cfefac2fcd61_9" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_8" [label="8: Prune (false branch, for loop) \n PRUNE(!(n$1 < 1), false); [line 18, column 19]\n " shape="invhouse"]
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_8" [label="8: Prune (true branch, for loop) \n PRUNE((n$1 < 10), true); [line 10, column 19]\n " shape="invhouse"]
|
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_8" -> "main.fad58de7366495db4650cfefac2fcd61_10" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_8" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_2" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_9" [label="9: Prune (false branch, for loop) \n PRUNE(!(n$1 < 10), false); [line 10, column 19]\n " shape="invhouse"]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_9" [label="9: LoopBody \n n$2=*&j:int [line 19, column 5]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_9" -> "main.fad58de7366495db4650cfefac2fcd61_3" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_9" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_5" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_10" [label="10: BinaryOperatorStmt: AddAssign \n n$2=*&j:int [line 11, column 10]\n n$3=*&j:int [line 11, column 5]\n *&j:int=(n$3 + n$2) [line 11, column 5]\n " shape="box"]
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_10" [label="10: DeclStmt \n VARIABLE_DECLARED(j:int); [line 17, column 3]\n *&j:int=0 [line 17, column 3]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_10" -> "main.fad58de7366495db4650cfefac2fcd61_6" ;
|
"for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_10" -> "for_loop_no_brackets.4c9da26592fb7fb2077b8ad5de66fe11_4" ;
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_11" [label="11: DeclStmt \n VARIABLE_DECLARED(j:int); [line 9, column 3]\n *&j:int=0 [line 9, column 3]\n " shape="box"]
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_1" [label="1: Start simple_for_loop\nFormals: \nLocals: i:int j:int \n " color=yellow style=filled]
|
||||||
|
|
||||||
|
|
||||||
"main.fad58de7366495db4650cfefac2fcd61_11" -> "main.fad58de7366495db4650cfefac2fcd61_5" ;
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_1" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_11" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_2" [label="2: Exit simple_for_loop \n " color=yellow style=filled]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_3" [label="3: Return Stmt \n *&return:int=0 [line 13, column 3]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_3" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_2" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_4" [label="4: + \n " ]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_4" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_7" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_5" [label="5: DeclStmt \n VARIABLE_DECLARED(i:int); [line 10, column 8]\n *&i:int=0 [line 10, column 8]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_5" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_4" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_6" [label="6: UnaryOperator \n n$0=*&i:int [line 10, column 27]\n *&i:int=(n$0 + 1) [line 10, column 27]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_6" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_4" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_7" [label="7: BinaryOperatorStmt: LT \n n$1=*&i:int [line 10, column 19]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_7" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_8" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_7" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_9" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_8" [label="8: Prune (true branch, for loop) \n PRUNE((n$1 < 10), true); [line 10, column 19]\n " shape="invhouse"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_8" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_10" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_9" [label="9: Prune (false branch, for loop) \n PRUNE(!(n$1 < 10), false); [line 10, column 19]\n " shape="invhouse"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_9" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_3" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_10" [label="10: BinaryOperatorStmt: AddAssign \n n$2=*&j:int [line 11, column 10]\n n$3=*&j:int [line 11, column 5]\n *&j:int=(n$3 + n$2) [line 11, column 5]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_10" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_6" ;
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_11" [label="11: DeclStmt \n VARIABLE_DECLARED(j:int); [line 9, column 3]\n *&j:int=0 [line 9, column 3]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
"simple_for_loop.620d527928c080a35fd7b56855111df4_11" -> "simple_for_loop.620d527928c080a35fd7b56855111df4_5" ;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue