File tree Expand file tree Collapse file tree
cpp/ql/test/query-tests/Likely Bugs/ContinueInFalseLoop Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11| test.cpp:13:4:13:12 | continue; | This 'continue' never re-runs the loop - the $@ is always false. | test.cpp:16:11:16:15 | 0 | loop condition |
22| test.cpp:59:5:59:13 | continue; | This 'continue' never re-runs the loop - the $@ is always false. | test.cpp:62:12:62:16 | 0 | loop condition |
3+ | test.cpp:88:4:88:12 | continue; | This 'continue' never re-runs the loop - the $@ is always false. | test.cpp:93:11:93:11 | 0 | loop condition |
Original file line number Diff line number Diff line change 11
22bool cond ();
33
4- void test1 ()
4+ void test1 (int x )
55{
66 int i;
77
@@ -72,4 +72,23 @@ void test1()
7272 break ;
7373 } while (true );
7474 } while (false );
75+
76+ do
77+ {
78+ switch (x)
79+ {
80+ case 1 :
81+ // do [1]
82+
83+ break ; // break out of the switch
84+
85+ default :
86+ // do [2]
87+
88+ continue ; // break out of the loop entirely, skipping [3] [FALSE POSITIVE]
89+ };
90+
91+ // do [3]
92+
93+ } while (0 );
7594}
You can’t perform that action at this time.
0 commit comments