Skip to content

Commit d3232ea

Browse files
committed
Java: Fix false positives in evaluation-to-constant query for ErrorType
1 parent 50e8680 commit d3232ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ predicate isConstantExp(Expr e) {
1919
// A literal is constant.
2020
e instanceof Literal
2121
or
22-
e instanceof TypeAccess
22+
exists(TypeAccess ta | ta = e | not ta.getType() instanceof ErrorType)
2323
or
2424
e instanceof ArrayTypeAccess
2525
or

0 commit comments

Comments
 (0)