File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
cpp/ql/src/Likely Bugs/Arithmetic Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ class ConstantZero extends Expr {
2121 */
2222private predicate lookForUnsignedAt ( GEExpr ge , Expr candidate ) {
2323 // Base case: `candidate >= 0`
24- ge .getRightOperand ( ) instanceof ConstantZero and
25- candidate = ge .getLeftOperand ( ) .getFullyConverted ( ) and
26- // left operand was a signed or unsigned IntegralType before conversions
24+ ge .getLesserOperand ( ) instanceof ConstantZero and
25+ candidate = ge .getGreaterOperand ( ) .getFullyConverted ( ) and
26+ // left/greater operand was a signed or unsigned IntegralType before conversions
2727 // (not a pointer, checking a pointer >= 0 is an entirely different mistake)
2828 // (not an enum, as the fully converted type of an enum is compiler dependent
2929 // so checking an enum >= 0 is always reasonable)
30- ge .getLeftOperand ( ) .getUnderlyingType ( ) instanceof IntegralType
30+ ge .getGreaterOperand ( ) .getUnderlyingType ( ) instanceof IntegralType
3131 or
3232 // Recursive case: `...(largerType)candidate >= 0`
3333 exists ( Conversion conversion |
You can’t perform that action at this time.
0 commit comments