mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Java: Sync files and update other relavant files related to the new naming of shift.
This commit is contained in:
@@ -14,7 +14,7 @@ int integralTypeWidth(IntegralType t) {
|
||||
if t.hasName("long") or t.hasName("Long") then result = 64 else result = 32
|
||||
}
|
||||
|
||||
from LShiftExpr shift, IntegralType t, int v, string typname, int width
|
||||
from LeftShiftExpr shift, IntegralType t, int v, string typname, int width
|
||||
where
|
||||
shift.getLeftOperand().getType() = t and
|
||||
shift.getRightOperand().(CompileTimeConstantExpr).getIntValue() = v and
|
||||
|
||||
@@ -33,9 +33,9 @@ class ArithmeticExpr extends BinaryExpr {
|
||||
*/
|
||||
class ShiftExpr extends BinaryExpr {
|
||||
ShiftExpr() {
|
||||
this instanceof LShiftExpr or
|
||||
this instanceof RShiftExpr or
|
||||
this instanceof URShiftExpr
|
||||
this instanceof LeftShiftExpr or
|
||||
this instanceof RightShiftExpr or
|
||||
this instanceof UnsignedRightShiftExpr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ Expr overFlowCand() {
|
||||
|
|
||||
bin instanceof AddExpr or
|
||||
bin instanceof MulExpr or
|
||||
bin instanceof LShiftExpr
|
||||
bin instanceof LeftShiftExpr
|
||||
)
|
||||
or
|
||||
exists(AssignOp op |
|
||||
@@ -109,7 +109,7 @@ Expr overFlowCand() {
|
||||
|
|
||||
op instanceof AssignAddExpr or
|
||||
op instanceof AssignMulExpr or
|
||||
op instanceof AssignLShiftExpr
|
||||
op instanceof AssignLeftShiftExpr
|
||||
)
|
||||
or
|
||||
exists(AddExpr add, CompileTimeConstantExpr c |
|
||||
|
||||
@@ -153,9 +153,9 @@ 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.(LShiftExpr).getAnOperand()) or
|
||||
inBitwiseAnd(exp.(RShiftExpr).getAnOperand()) or
|
||||
inBitwiseAnd(exp.(URShiftExpr).getAnOperand())
|
||||
inBitwiseAnd(exp.(LeftShiftExpr).getAnOperand()) or
|
||||
inBitwiseAnd(exp.(RightShiftExpr).getAnOperand()) or
|
||||
inBitwiseAnd(exp.(UnsignedRightShiftExpr).getAnOperand())
|
||||
}
|
||||
|
||||
/** Holds if overflow/underflow is irrelevant for this expression. */
|
||||
|
||||
@@ -16,10 +16,10 @@ class NumericNarrowingCastExpr extends CastExpr {
|
||||
|
||||
class RightShiftOp extends Expr {
|
||||
RightShiftOp() {
|
||||
this instanceof RShiftExpr or
|
||||
this instanceof URShiftExpr or
|
||||
this instanceof AssignRShiftExpr or
|
||||
this instanceof AssignURShiftExpr
|
||||
this instanceof RightShiftExpr or
|
||||
this instanceof UnsignedRightShiftExpr or
|
||||
this instanceof AssignRightShiftExpr or
|
||||
this instanceof AssignUnsignedRightShiftExpr
|
||||
}
|
||||
|
||||
private Expr getLhs() {
|
||||
|
||||
Reference in New Issue
Block a user