mirror of
https://github.com/github/codeql.git
synced 2026-01-06 11:10:23 +01:00
Java: Deprecate ParExpr.
This commit is contained in:
@@ -14,7 +14,7 @@ private import semmle.code.java.controlflow.internal.GuardsLogic
|
||||
predicate narrowerThanOrEqualTo(ArithExpr exp, NumType numType) {
|
||||
exp.getType().(NumType).widerThan(numType)
|
||||
implies
|
||||
exists(CastExpr cast | cast.getAChildExpr().getProperExpr() = exp |
|
||||
exists(CastExpr cast | cast.getAChildExpr() = exp |
|
||||
numType.widerThanOrEqualTo(cast.getType().(NumType))
|
||||
)
|
||||
}
|
||||
@@ -54,11 +54,11 @@ private Guard sizeGuard(SsaVariable v, boolean branch, boolean upper) {
|
||||
positive(pos) and
|
||||
upper = true
|
||||
|
|
||||
comp.getLesserOperand().getProperExpr() = add and
|
||||
comp.getLesserOperand() = add and
|
||||
comp.getGreaterOperand().(IntegerLiteral).getIntValue() = 0 and
|
||||
branch = false
|
||||
or
|
||||
comp.getGreaterOperand().getProperExpr() = add and
|
||||
comp.getGreaterOperand() = add and
|
||||
comp.getLesserOperand().(IntegerLiteral).getIntValue() = 0 and
|
||||
branch = true
|
||||
)
|
||||
@@ -157,7 +157,6 @@ predicate upcastToWiderType(Expr e) {
|
||||
/** Holds if the result of `exp` has certain bits filtered by a bitwise and. */
|
||||
private predicate inBitwiseAnd(Expr exp) {
|
||||
exists(AndBitwiseExpr a | a.getAnOperand() = exp) or
|
||||
inBitwiseAnd(exp.(ParExpr).getExpr()) or
|
||||
inBitwiseAnd(exp.(LShiftExpr).getAnOperand()) or
|
||||
inBitwiseAnd(exp.(RShiftExpr).getAnOperand()) or
|
||||
inBitwiseAnd(exp.(URShiftExpr).getAnOperand())
|
||||
|
||||
@@ -29,7 +29,7 @@ class RightShiftOp extends Expr {
|
||||
|
||||
Variable getShiftedVariable() {
|
||||
getLhs() = result.getAnAccess() or
|
||||
getLhs().getProperExpr().(AndBitwiseExpr).getAnOperand() = result.getAnAccess()
|
||||
getLhs().(AndBitwiseExpr).getAnOperand() = result.getAnAccess()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@ predicate subCondition(Expr cond, Expr subcond, boolean negated) {
|
||||
or
|
||||
subCondition(cond.(OrLogicalExpr).getAnOperand(), subcond, negated)
|
||||
or
|
||||
subCondition(cond.(ParExpr).getExpr(), subcond, negated)
|
||||
or
|
||||
subCondition(cond.(LogNotExpr).getExpr(), subcond, negated.booleanNot())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user