Description
Infer fails to report an INFINITE_EXECUTION_TIME error when a for loop has an empty increment expression and the loop variable is never modified, resulting in an obvious infinite loop.
public class TestInfiniteLoop {
static void bugMissed() {
int j;
for (j = 0; j <= 1;) {} // <- should report INFINITE_EXECUTION_TIME (FN)
}
}
Expected behavior
INFINITE_EXECUTION_TIME should be reported for void TestInfiniteLoop.bugMissed(), since the function contains a non-terminating loop whose execution cost is ∞.
Actual behavior
The infinite loop is silently ignored.
Description
Infer fails to report an INFINITE_EXECUTION_TIME error when a for loop has an empty increment expression and the loop variable is never modified, resulting in an obvious infinite loop.
Expected behavior
INFINITE_EXECUTION_TIME should be reported for void TestInfiniteLoop.bugMissed(), since the function contains a non-terminating loop whose execution cost is ∞.
Actual behavior
The infinite loop is silently ignored.