You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
infer doesn't seem to know the assert keyword or to handle it correctly.
Simple reproducer:
keruspe@Lou /tmp/infer % cat test.java
public class test {
int test() {
String s = null;
return s.length();
}
}
keruspe@Lou /tmp/infer % infer -- javac test.java
Starting analysis (Infer version git-17f0b5cbe2a1d4dd5831c79ce43bdb6c0e5da230)
Analysis done
1 file analyzed
/tmp/infer/test.java:4: error: NULL_DEREFERENCE
object s last assigned on line 3 could be null and is dereferenced at line 4
keruspe@Lou /tmp/infer % vim test.java
keruspe@Lou /tmp/infer % cat test.java
public class test {
int test() {
String s = null;
assert s != null;
return s.length();
}
}
keruspe@Lou /tmp/infer % infer -- javac test.java
Starting analysis (Infer version git-17f0b5cbe2a1d4dd5831c79ce43bdb6c0e5da230)
Analysis done
1 file analyzed
/tmp/infer/test.java:5: error: NULL_DEREFERENCE
object s last assigned on line 3 could be null and is dereferenced at line 5
I expect this last infer run not to tell be s can be null as the assert just above tells otherwise
The text was updated successfully, but these errors were encountered:
infer doesn't seem to know the assert keyword or to handle it correctly.
Simple reproducer:
I expect this last infer run not to tell be s can be null as the assert just above tells otherwise
The text was updated successfully, but these errors were encountered: