mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
C++: Make exprMightOverflowPositively/exprMightOverFlowNegatively hold for unanalyzable expressions. This hopefully means that expressions that do not satisfy these predicates will never overflow/underflow.
This commit is contained in:
@@ -1630,6 +1630,9 @@ private module SimpleRangeAnalysisCached {
|
||||
// bound of `x`, so the standard logic (above) does not work for
|
||||
// detecting whether it might overflow.
|
||||
getLowerBoundsImpl(expr.(PostfixDecrExpr)) = exprMinVal(expr)
|
||||
or
|
||||
// Expressions we cannot analyze could potentially overflow
|
||||
not analyzableExpr(expr)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1657,6 +1660,9 @@ private module SimpleRangeAnalysisCached {
|
||||
// bound of `x`, so the standard logic (above) does not work for
|
||||
// detecting whether it might overflow.
|
||||
getUpperBoundsImpl(expr.(PostfixIncrExpr)) = exprMaxVal(expr)
|
||||
or
|
||||
// Expressions we cannot analyze could potentially overflow
|
||||
not analyzableExpr(expr)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user