Issue type not being detected - INVARIANT_CALL
- Dominant language
- OCaml
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 19h 36m
- Merged PRs (30d)
- 13
Description
According to Infers documentation Infer should detect (INVARIANT_CALL) but nothing is being detected in this code snippet below. Please are you able to help look into this or provide explanation.
Below is the Java code:import com.facebook.infer.annotation.Expensive;
class Main {
@Expensive
public int foo(int x, int y) {
return x + y;
}
public void invariant_hoist(int size) {
int x = 10;
int y = 5;
for (int i = 0; i < size; i++) {
foo(x, y);
}
}
public int showBug(int size) {
invariant_hoist(size);
return foo(10, 5);
}
public static void main(String[] args) {
Main main = new Main();
main.showBug(10);
}
}
Command used:
infer run --loop-hoisting -- javac Main.java
infer run --cost -- javac Main.java
Infer versions:
Tested in both Infer version 1.0.0 and 1.2.0
Contributor guide
Assessment
This issue has not been assessed yet.