- Notifications
You must be signed in to change notification settings - Fork1.7k
Ruby: Diff-informed queries: phase 3 (non-trivial locations)#20080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds support for diff-informed queries in Ruby by implementing location overrides for queries that select non-trivial locations (not just dataflow sources or sinks). It's part of phase 3 of enabling diff-informed mode across all languages, completing the mass-enablement process.
Key changes:
- Adds
observeDiffInformedIncrementalMode()
predicate to disable diff-informed mode for specific queries where it's not suitable - Implements workaround for Ruby RegExp parsing issues when constants are folded
@@ -17,6 +17,10 @@ private module MissingFullAnchorConfig implements DataFlow::ConfigSig { | |||
predicateisSink(DataFlow::Nodesink){sinkinstanceofSink} | |||
predicateisBarrier(DataFlow::Nodenode){nodeinstanceofSanitizer} | |||
predicateobserveDiffInformedIncrementalMode(){ | |||
none()// can't be made diff-informed because the locations of Ruby RegExpTerms aren't correct when the regexp is parsed from a string arising from constant folding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The comment should be more specific about what 'aren't correct' means. Consider clarifying whether the locations are missing, inaccurate, or point to the wrong source positions.
none()// can't be made diff-informed because the locations of Ruby RegExpTermsaren't correct when the regexp is parsed from a string arising from constant folding | |
none()// can't be made diff-informed because the locations of Ruby RegExpTermsare inaccurate or point to incorrect source positions when the regexp is parsed from a string arising from constant folding |
Copilot uses AI. Check for mistakes.
This PR enables diff-informed mode on queries that select a location other than dataflow source or sink. This entails adding a non-trivial location override that returns the locations that are actually selected.
Prior work includes PRs like#19663,#19759, and#19817. This PR uses the same patch script as those PRs to find candidate queries to convert to diff-enabled. This is the final step in mass-enabling diff-informed queries on all the languages.
Commit-by-commit reviewing is recommended.