Ruby: Simplify ExprReturnNode to not rely on CFG - #22256
Draft
aschackmull wants to merge 1 commit into
Draft
Conversation
aschackmull
force-pushed
the
ruby/implicitreturn
branch
from
July 30, 2026 10:55
27f0505 to
6ee164f
Compare
aschackmull
marked this pull request as ready for review
July 30, 2026 10:59
Contributor
There was a problem hiding this comment.
Pull request overview
Simplifies Ruby expression-return detection by avoiding CFG structure assumptions.
Changes:
- Adds a helper to resolve desugared AST nodes.
- Identifies implicit returns from a callable’s final statement.
Show a summary per file
| File | Description |
|---|---|
ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll |
Refactors ExprReturnNode detection to use AST structure rather than CFG successors. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Medium
aschackmull
marked this pull request as draft
July 31, 2026 07:07
Contributor
Author
|
Dca indicates some semantic mishap. |
aschackmull
force-pushed
the
ruby/implicitreturn
branch
from
July 31, 2026 13:25
6ee164f to
4aec6bd
Compare
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.
I believe this refactor should be equivalent and avoids the implicit assumptions about the structure of the CFG.