We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb38c60 commit e4b6417Copy full SHA for e4b6417
c/cert/src/rules/INT33-C/DivOrRemByZero.ql
@@ -12,14 +12,14 @@
12
13
import cpp
14
import codingstandards.c.cert
15
+import codingstandards.cpp.Overflow
16
import semmle.code.cpp.controlflow.Guards
17
import semmle.code.cpp.valuenumbering.GlobalValueNumbering
18
-from BinaryArithmeticOperation divOrMod, Expr divisor
19
+from DivOrRemOperation divOrMod, Expr divisor
20
where
21
not isExcluded(divOrMod, IntegerOverflowPackage::divOrRemByZeroQuery()) and
- divOrMod.getOperator() = ["/", "%"] and
22
- divisor = divOrMod.getRightOperand() and
+ divisor = divOrMod.getDivisor() and
23
divisor.getType() instanceof IntegralType and
24
// Range includes 0
25
upperBound(divisor) >= 0 and
0 commit comments