mirror of
https://github.com/github/codeql.git
synced 2026-06-14 09:21:07 +02:00
First pass converting qlref tests to inline expectation with postprocess
This commit is contained in:
@@ -5,14 +5,14 @@ class A {
|
||||
|
||||
void f(int initx) {
|
||||
boolean done = false;
|
||||
while(!done) { // BAD: main loop condition is constant in the loop
|
||||
while(!done) { // $ Alert // BAD: main loop condition is constant in the loop
|
||||
if (otherCond()) break;
|
||||
}
|
||||
|
||||
int x = initx * 2;
|
||||
int i = 0;
|
||||
for(x++; ; i++) {
|
||||
if (x > 5 && otherCond()) { // BAD: x>5 is constant in the loop and guards all exits
|
||||
if (x > 5 && otherCond()) { // $ Alert // BAD: x>5 is constant in the loop and guards all exits
|
||||
if (i > 3) break;
|
||||
if (otherCond()) return;
|
||||
}
|
||||
@@ -26,14 +26,14 @@ class A {
|
||||
i++;
|
||||
}
|
||||
|
||||
for(int j = 0; j < 2 * initx; i++) { // BAD: j<initx is constant in the loop
|
||||
for(int j = 0; j < 2 * initx; i++) { // $ Alert // BAD: j<initx is constant in the loop
|
||||
}
|
||||
|
||||
while(initx > 0) { // OK: loop used as an if-statement
|
||||
break;
|
||||
}
|
||||
|
||||
while (cond) { // BAD: read of final field
|
||||
while (cond) { // $ Alert // BAD: read of final field
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user