False Negative: INFINITE_EXECUTION_TIME missing for empty-increment for loop
Open
false-negative
java
- Dominant language
- OCaml
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 19h 36m
- Merged PRs (30d)
- 13
Description
**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.
```java
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.
Contributor guide
Assessment
This issue has not been assessed yet.