mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: Fix bug in ConstantExpAppearsNonConstant.
This commit is contained in:
@@ -19,7 +19,7 @@ predicate isConstantExp(Expr e) {
|
|||||||
// A literal is constant.
|
// A literal is constant.
|
||||||
e instanceof Literal
|
e instanceof Literal
|
||||||
or
|
or
|
||||||
e instanceof TypeAccess and not e.(TypeAccess).getType() instanceof ErrorType
|
e instanceof TypeAccess
|
||||||
or
|
or
|
||||||
e instanceof ArrayTypeAccess
|
e instanceof ArrayTypeAccess
|
||||||
or
|
or
|
||||||
@@ -53,6 +53,7 @@ predicate isConstantExp(Expr e) {
|
|||||||
from Expr e
|
from Expr e
|
||||||
where
|
where
|
||||||
isConstantExp(e) and
|
isConstantExp(e) and
|
||||||
|
not e.(TypeAccess).getType() instanceof ErrorType and
|
||||||
exists(Expr child | e.getAChildExpr() = child |
|
exists(Expr child | e.getAChildExpr() = child |
|
||||||
not isConstantExp(child) and
|
not isConstantExp(child) and
|
||||||
not child instanceof Annotation
|
not child instanceof Annotation
|
||||||
|
|||||||
Reference in New Issue
Block a user