mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Merge pull request #2454 from aschackmull/java/explicit-mul-zero
Java: Allow explicit zero multiplication in java/evaluation-to-constant.
This commit is contained in:
@@ -74,6 +74,8 @@ where
|
||||
not child instanceof Annotation
|
||||
) and
|
||||
not e instanceof CompileTimeConstantExpr and
|
||||
// Exclude explicit zero multiplication.
|
||||
not e.(MulExpr).getAnOperand().(IntegerLiteral).getIntValue() = 0 and
|
||||
// Exclude expressions that appear to be disabled deliberately (e.g. `false && ...`).
|
||||
not e.(AndLogicalExpr).getAnOperand().(BooleanLiteral).getBooleanValue() = false
|
||||
select e, "Expression always evaluates to the same value."
|
||||
|
||||
Reference in New Issue
Block a user