We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7d2e0c commit 7d491afCopy full SHA for 7d491af
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/inconsistentLoopDirection/inconsistentLoopDirection.cpp
@@ -179,7 +179,7 @@ void FalseNegativeTestCases()
179
for (int i = 100; i > 0; i ++ ) {} // BUG
180
}
181
182
-void IntendedOverflow()
+void IntendedOverflow(unsigned char p)
183
{
184
const unsigned char m = 10;
185
unsigned char i;
@@ -195,4 +195,7 @@ void IntendedOverflow()
195
196
for (s = 63; s < 64; s--) {} // BAD (signed numbers don't wrap at 0 / at all)
197
for (s = m + 1; s < m; s--) {} // BAD (never runs)
198
+
199
+ for (i = p - 1; i < p; i--) {} // GOOD
200
+ for (s = p - 1; s < p; s--) {} // BAD [NOT DETECTED]
201
0 commit comments