Open
Conversation
4f6656a to
dc8cd62
Compare
dc8cd62 to
4b36463
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Ruby CodeQL libraries to improve evaluation behavior (per the referenced DCA check), primarily by adding/adjusting QL pragmas and introducing small wrapper predicates to encourage more predictable/efficient binding and inlining.
Changes:
- Added/expanded uses of
pragma[only_bind_into],pragma[inline], andpragma[inline_late]in several core/framework libraries. - Refactored a few predicates/methods into
*Implimplementations with thin inline wrappers (notably in AST scope handling and dataflow node scoping). - Minor internal factoring in ActiveRecord and dataflow dispatch to isolate sub-conditions into dedicated predicates.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ruby/ql/lib/codeql/ruby/frameworks/core/Hash.qll | Adds only_bind_into to method-call selection for summaries. |
| ruby/ql/lib/codeql/ruby/frameworks/core/Array.qll | Adds only_bind_into to method-call selection for summaries. |
| ruby/ql/lib/codeql/ruby/frameworks/ActiveRecord.qll | Adds nomagic and factors association method-call condition into a helper predicate. |
| ruby/ql/lib/codeql/ruby/frameworks/actiondispatch/internal/Routing.qll | Marks underscore with inline_late. |
| ruby/ql/lib/codeql/ruby/frameworks/actioncontroller/Filters.qll | Introduces an inline_late wrapper around lookupMethod and uses it for filter callable resolution. |
| ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll | Refactors getCfgScope into getCfgScopeImpl + inline wrapper; adds a helper predicate for module compatibility. |
| ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowDispatch.qll | Factors private/protected method filtering into inline_late helper predicates. |
| ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll | Refactors cached scope predicates into *Impl and adds inline_late wrappers. |
| ruby/ql/lib/codeql/ruby/ast/internal/Module.qll | Adjusts top-level file restriction logic using a forall-based formulation. |
| ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll | Adds an inline_late getTokenValue helper and routes token-value reads through it. |
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.
DCA looks good.