mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #20546 from github/idrissrio/ql-constant
Java: Fix false positives in evaluation-to-constant query for ErrorType
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
query: Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
public static void updateFlashlights(Minecraft mc){
|
||||
if(mc.world != null){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
def test(codeql, java):
|
||||
codeql.database.create(build_mode="none")
|
||||
@@ -19,7 +19,7 @@ predicate isConstantExp(Expr e) {
|
||||
// A literal is constant.
|
||||
e instanceof Literal
|
||||
or
|
||||
e instanceof TypeAccess
|
||||
e instanceof TypeAccess and not e.(TypeAccess).getType() instanceof ErrorType
|
||||
or
|
||||
e instanceof ArrayTypeAccess
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user