Files
codeql/cpp/ql/src/Likely Bugs/NestedLoopSameVar.cpp
2018-11-07 11:32:17 -08:00

17 lines
334 B
C++

int x1 = 0;
for (x1 = 0; x1 < 100; x1++) {
int x2 = 0;
for (x1 = 0; x1 < 300; x1++) {
// this is most likely a typo
// the outer loop will exit immediately
}
}
for (x1 = 0; x1 < 100; x1++) {
if(x1 == 10 && condition) {
for (; x1 < 75; x1++) {
// this should be written as a while loop
}
}
}