mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Java: Rename UnaryExpr.getExpr to getOperand.
This commit is contained in:
@@ -32,7 +32,7 @@ class AnyAssignment extends Expr {
|
||||
/** The expression modified by this assignment. */
|
||||
Expr getDest() {
|
||||
this.(Assignment).getDest() = result or
|
||||
this.(UnaryAssignExpr).getExpr() = result
|
||||
this.(UnaryAssignExpr).getOperand() = result
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ predicate subCondition(Expr cond, Expr subcond, boolean negated) {
|
||||
or
|
||||
subCondition(cond.(OrLogicalExpr).getAnOperand(), subcond, negated)
|
||||
or
|
||||
subCondition(cond.(LogNotExpr).getExpr(), subcond, negated.booleanNot())
|
||||
subCondition(cond.(LogNotExpr).getOperand(), subcond, negated.booleanNot())
|
||||
}
|
||||
|
||||
from
|
||||
|
||||
@@ -98,9 +98,9 @@ where
|
||||
or
|
||||
conditionalWithBool(e, pattern, rewrite)
|
||||
or
|
||||
e.(LogNotExpr).getExpr().(ComparisonOrEquality).negate(pattern, rewrite)
|
||||
e.(LogNotExpr).getOperand().(ComparisonOrEquality).negate(pattern, rewrite)
|
||||
or
|
||||
e.(LogNotExpr).getExpr() instanceof LogNotExpr and
|
||||
e.(LogNotExpr).getOperand() instanceof LogNotExpr and
|
||||
pattern = "!!A" and
|
||||
rewrite = "A"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import java
|
||||
import DeadLocals
|
||||
|
||||
predicate minusOne(MinusExpr e) { e.getExpr().(Literal).getValue() = "1" }
|
||||
predicate minusOne(MinusExpr e) { e.getOperand().(Literal).getValue() = "1" }
|
||||
|
||||
predicate flowStep(Expr decl, Expr init) {
|
||||
decl = init
|
||||
|
||||
@@ -66,7 +66,7 @@ where
|
||||
fr.getField() = f and
|
||||
not f.getDeclaringType() instanceof EnumType and
|
||||
forall(Assignment ae | ae.getDest() = f.getAnAccess() | ae.getSource() instanceof NullLiteral) and
|
||||
not exists(UnaryAssignExpr ua | ua.getExpr() = f.getAnAccess()) and
|
||||
not exists(UnaryAssignExpr ua | ua.getOperand() = f.getAnAccess()) and
|
||||
not f.isFinal() and
|
||||
// Exclude fields that may be accessed reflectively.
|
||||
not reflectivelyWritten(f) and
|
||||
|
||||
Reference in New Issue
Block a user