Summary: The successor node of `continue` was not correct inside the `do while`. Reviewed By: sblackshear Differential Revision: D5769578 fbshipit-source-id: d7b0843master
parent
beb98c6baa
commit
822ffc6f62
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2016 - present Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
int test1(bool a, bool b) {
|
||||
int x = 0;
|
||||
do {
|
||||
x = x + 1;
|
||||
if (a) {
|
||||
x = x + 2;
|
||||
continue;
|
||||
} else {
|
||||
x = x + 3;
|
||||
}
|
||||
x = x + 4;
|
||||
} while (b);
|
||||
return x;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/* @generated */
|
||||
digraph iCFG {
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_1" [label="1: Start test1\nFormals: a:_Bool b:_Bool\nLocals: x:int \n DECLARE_LOCALS(&return,&x); [line 10]\n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_1" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_14" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_2" [label="2: Exit test1 \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_3" [label="3: Return Stmt \n n$0=*&x:int [line 22]\n *&return:int=n$0 [line 22]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_3" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_2" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_4" [label="4: + \n " ]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_4" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_13" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_5" [label="5: Prune (true branch) \n n$1=*&b:_Bool [line 21]\n PRUNE((n$1 != 0), true); [line 21]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_5" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_4" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_6" [label="6: Prune (false branch) \n n$1=*&b:_Bool [line 21]\n PRUNE((n$1 == 0), false); [line 21]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_6" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_3" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_7" [label="7: BinaryOperatorStmt: Assign \n n$2=*&x:int [line 20]\n *&x:int=(n$2 + 4) [line 20]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_7" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_5" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_7" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_6" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_8" [label="8: + \n " ]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_8" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_7" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_9" [label="9: Prune (true branch) \n n$3=*&a:_Bool [line 14]\n PRUNE((n$3 != 0), true); [line 14]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_9" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_11" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_10" [label="10: Prune (false branch) \n n$3=*&a:_Bool [line 14]\n PRUNE((n$3 == 0), false); [line 14]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_10" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_12" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_11" [label="11: BinaryOperatorStmt: Assign \n n$4=*&x:int [line 15]\n *&x:int=(n$4 + 2) [line 15]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_11" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_5" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_11" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_6" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_12" [label="12: BinaryOperatorStmt: Assign \n n$5=*&x:int [line 18]\n *&x:int=(n$5 + 3) [line 18]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_12" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_8" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_13" [label="13: BinaryOperatorStmt: Assign \n n$6=*&x:int [line 13]\n *&x:int=(n$6 + 1) [line 13]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_13" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_9" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_13" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_10" ;
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_14" [label="14: DeclStmt \n *&x:int=0 [line 11]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_14" -> "test1#_Z5test1bb.7b4b302df017dfac2074bf17bf65ca2c_4" ;
|
||||
}
|
Loading…
Reference in new issue