@@ -63,7 +63,7 @@ predicate missingGuardAgainstOverflow(Operation e, VariableAccess use) {
6363 exists ( LocalScopeVariable v | use .getTarget ( ) = v |
6464 // overflow possible if large
6565 ( e instanceof AddExpr and not guardedLesser ( e , varUse ( v ) ) ) or
66- ( e instanceof IncrementOperation and not guardedLesser ( e , varUse ( v ) ) ) or
66+ ( e instanceof IncrementOperation and not guardedLesser ( e , varUse ( v ) ) and v . getType ( ) . getUnspecifiedType ( ) instanceof IntegralType ) or
6767 // overflow possible if large or small
6868 ( e instanceof MulExpr and
6969 not ( guardedLesser ( e , varUse ( v ) ) and guardedGreater ( e , varUse ( v ) ) ) )
@@ -77,7 +77,7 @@ predicate missingGuardAgainstUnderflow(Operation e, VariableAccess use) {
7777 // underflow possible if use is left operand and small
7878 ( use = e .( SubExpr ) .getLeftOperand ( ) and not guardedGreater ( e , varUse ( v ) ) ) or
7979 // underflow possible if small
80- ( e instanceof DecrementOperation and not guardedGreater ( e , varUse ( v ) ) ) or
80+ ( e instanceof DecrementOperation and not guardedGreater ( e , varUse ( v ) ) and v . getType ( ) . getUnspecifiedType ( ) instanceof IntegralType ) or
8181 // underflow possible if large or small
8282 ( e instanceof MulExpr and
8383 not ( guardedLesser ( e , varUse ( v ) ) and guardedGreater ( e , varUse ( v ) ) ) )
0 commit comments