Skip to content

Commit e4b6417

Browse files
committed
INT33-C: Include assign div/mod
1 parent cb38c60 commit e4b6417

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

c/cert/src/rules/INT33-C/DivOrRemByZero.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
import cpp
1414
import codingstandards.c.cert
15+
import codingstandards.cpp.Overflow
1516
import semmle.code.cpp.controlflow.Guards
1617
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
1718

18-
from BinaryArithmeticOperation divOrMod, Expr divisor
19+
from DivOrRemOperation divOrMod, Expr divisor
1920
where
2021
not isExcluded(divOrMod, IntegerOverflowPackage::divOrRemByZeroQuery()) and
21-
divOrMod.getOperator() = ["/", "%"] and
22-
divisor = divOrMod.getRightOperand() and
22+
divisor = divOrMod.getDivisor() and
2323
divisor.getType() instanceof IntegralType and
2424
// Range includes 0
2525
upperBound(divisor) >= 0 and

0 commit comments

Comments
 (0)