Rust: Model futures::executor::block_on.#19095
Merged
geoffw0 merged 4 commits intogithub:mainfrom Apr 7, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a model for futures::executor::block_on, ensuring that the function is appropriately reflected in the code analysis.
- Added a new model extension in futures.model.yml to capture block_on's behavior.
- Updated a test case in main.rs to properly indicate the value flow for futures::executor::block_on.
Reviewed Changes
Copilot reviewed 2 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| rust/ql/lib/codeql/rust/frameworks/futures.model.yml | Added a model extension entry for futures::executor::block_on. |
| rust/ql/test/library-tests/dataflow/global/main.rs | Updated the comment to reflect the corrected hasValueFlow. |
Files not reviewed (4)
- rust/ql/test/library-tests/dataflow/global/inline-flow.expected: Language not supported
- rust/ql/test/library-tests/dataflow/global/viableCallable.expected: Language not supported
- rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected: Language not supported
- rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected: Language not supported
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
Contributor
Author
|
@paldepind this is a small change that has been waiting around a while. Would you mind giving a quick review? |
paldepind
previously approved these changes
Apr 7, 2025
Contributor
paldepind
left a comment
There was a problem hiding this comment.
Thanks for the heads up. LGTM!
Contributor
Author
|
Fixed merge. |
paldepind
approved these changes
Apr 7, 2025
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.
Model
futures::executor::block_on. I believe several variations of this model couldn't be made to work a month ago, but work has been done on futures since and it now works (in its simplest form). Fixes a test case.