Merge pull request #475 from geoffw0/av_164

CPP: Fix AV Rule 164
This commit is contained in:
Jonas Jensen
2018-11-19 14:23:36 +01:00
committed by GitHub
4 changed files with 38 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ predicate constantValue(Expr e, int value) {
predicate violation(BinaryBitwiseOperation op, int lhsBytes, int value) {
(op instanceof LShiftExpr or op instanceof RShiftExpr) and
constantValue(op.getRightOperand(), value) and
lhsBytes = op.getLeftOperand().getType().getSize() and
lhsBytes = op.getLeftOperand().getExplicitlyConverted().getType().getSize() and
(value < 0 or value >= lhsBytes * 8)
}