Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: Model futures::executor::block_on. #19095

Merged
merged 4 commits into from
Apr 7, 2025
Merged

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Mar 21, 2025

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.

@geoffw0 geoffw0 added the Rust Pull requests that update Rust code label Mar 21, 2025
@Copilot Copilot bot review requested due to automatic review settings March 21, 2025 17:07
@geoffw0 geoffw0 added the no-change-note-required This PR does not need a change note label Mar 21, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 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

@geoffw0
Copy link
Contributor Author

geoffw0 commented Apr 4, 2025

@paldepind this is a small change that has been waiting around a while. Would you mind giving a quick review?

paldepind
paldepind previously approved these changes Apr 7, 2025
Copy link
Contributor

@paldepind paldepind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up. LGTM!

@geoffw0
Copy link
Contributor Author

geoffw0 commented Apr 7, 2025

Fixed merge.

@geoffw0 geoffw0 merged commit 88439b4 into github:main Apr 7, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants