Java: Sync files and update other relavant files related to the new naming of shift.

This commit is contained in:
Michael Nebel
2023-01-10 09:42:20 +01:00
parent 49a87e152a
commit 5c466f3319
14 changed files with 91 additions and 73 deletions

View File

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

View File

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

View File

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

View File

@@ -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. */

View File

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