Java: Deprecate ParExpr.

This commit is contained in:
Anders Schack-Mulligen
2020-01-29 15:52:07 +01:00
parent c4d2163321
commit 75c549baa1
48 changed files with 87 additions and 172 deletions

View File

@@ -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())

View File

@@ -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()
}
}

View File

@@ -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())
}