CodeQL library for C#
codeql/csharp-all 0.8.12 (changelog, source)
Search

Module ModulusAnalysis

Provides inferences of the form: e equals b + v modulo m where e is an expression, b is a Bound (typically zero or the value of an SSA variable), and v is an integer in the range [0 .. m-1].

Import path

import semmle.code.csharp.dataflow.ModulusAnalysis

Predicates

exprModulus

Holds if e is equal to b + val modulo mod.