Java: Introduce Modulus analysis.#301
Merged
Merged
Conversation
2ac1c3a to
1a66f7e
Compare
Contributor
Author
|
Added a commit including test to fix a regression relative to the ParityAnalysis when the array length is a constant. |
yh-semmle
reviewed
Oct 17, 2018
| @@ -1,4 +1,6 @@ | |||
| /** | |||
| * DEPRECATED: semmle.code.java.dataflow.ModulusAnalysis instead. | |||
Contributor
There was a problem hiding this comment.
Missing word "use" before the library name.
Ditto further below.
yh-semmle
approved these changes
Oct 17, 2018
aibaars
pushed a commit
that referenced
this pull request
Oct 14, 2021
Fix filenames in source archives
smowton
added a commit
to smowton/codeql
that referenced
this pull request
Apr 16, 2022
Extract a clinit method for Kotlin files
MathiasVP
pushed a commit
to MathiasVP/ql
that referenced
this pull request
Dec 16, 2025
…concat PS: Actually require string concatenation in SQL injection query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This replaces the parity analysis with a more general modulus analysis. The basis of the analysis is the same
Boundclass as is used in the range analysis, so the inferred facts are of the form:e = b + v (mod m)whereeis an expression,bis aBound, andvandmare integers. The simple case of a constant congruence facte = v (mod m)is then given byexprModulus(e, any(ZeroBound zb), v, m). This allows the range analysis to strengthen bounds further. As an example,for(int i = 0; i < 3*n; i+=3)is inferred to be equivalent tofor(int i = 0; i < 3*n - 2; i+=3).The
gcdpredicate is currently implemented only for small numbers, but will be replaced with the built-in predicate once 1.19 is released.The PR is structured with individually reviewable commits.