mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
RangeAnalysis: Improve bounds that rely on relative modulus.
This commit is contained in:
@@ -264,6 +264,13 @@ module ModulusAnalysis<
|
||||
val = remainder(val0 + delta, mod)
|
||||
)
|
||||
or
|
||||
exists(Sem::Expr mid, int v, int m1, int m2 |
|
||||
exprModulus(mid, b, v, m1) and
|
||||
e = modExpr(mid, m2) and
|
||||
mod = m1.gcd(m2) and
|
||||
val = remainder(v, mod)
|
||||
)
|
||||
or
|
||||
exists(Sem::ConditionalExpr cond, int v1, int v2, int m1, int m2 |
|
||||
cond = e and
|
||||
condExprBranchModulus(cond, true, b, v1, m1) and
|
||||
|
||||
Reference in New Issue
Block a user