From 99f5dcaaa4a9fe4b59d977c4c2cc925c0ae04cfc Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Wed, 8 Oct 2025 10:32:51 +0200 Subject: [PATCH] Java: Fix bug in ConstantExpAppearsNonConstant. --- .../Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql b/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql index 28ae63bfd36..4bbeefaee6e 100644 --- a/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql +++ b/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql @@ -19,7 +19,7 @@ predicate isConstantExp(Expr e) { // A literal is constant. e instanceof Literal or - e instanceof TypeAccess and not e.(TypeAccess).getType() instanceof ErrorType + e instanceof TypeAccess or e instanceof ArrayTypeAccess or @@ -53,6 +53,7 @@ predicate isConstantExp(Expr e) { from Expr e where isConstantExp(e) and + not e.(TypeAccess).getType() instanceof ErrorType and exists(Expr child | e.getAChildExpr() = child | not isConstantExp(child) and not child instanceof Annotation