Rust: Assume callbacks will be invoked in library functions - #22287
Draft
hvitved wants to merge 2 commits into
Draft
Rust: Assume callbacks will be invoked in library functions#22287hvitved wants to merge 2 commits into
hvitved wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds heuristic Rust data-flow modeling for callbacks invoked by external library functions.
Changes:
- Models external
Fn/FnOncecallback invocation. - Aligns closure-self access paths and excludes external stubs from CFG scopes.
- Adds callback flow tests and expected results.
Show a summary per file
| File | Description |
|---|---|
ModelsAsData.qll |
Adds heuristic callback summaries. |
DataFlowImpl.qll |
Standardizes the closure-self label. |
Scope.qll |
Excludes external stubs from callable CFG scopes. |
main.rs |
Adds callback flow assertions. |
external_file.rs |
Defines external callback fixtures. |
inline-flow.ext.yml |
Marks the fixture as external. |
inline-flow.expected |
Records expected flow results. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced
hvitved
force-pushed
the
rust/default-callback-models
branch
from
August 6, 2026 08:28
4c49096 to
e9bd698
Compare
geoffw0
reviewed
Aug 6, 2026
geoffw0
left a comment
Contributor
There was a problem hiding this comment.
LGTM, pending DCA outcome (I'd be a little surprised if we don't get some new flow there).
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.
Flow through captured variables relies on being able to see calls to the capturing closures. For calls that happen inside library functions we hence need a flow model, which this PR adds, similar to other languages (e.g. Java).