-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust: make MacroStmts expressions #19335
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
Open
aibaars
wants to merge
5
commits into
main
Choose a base branch
from
aibaars/macro-stmts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
faa65eb
to
b981967
Compare
There was a problem hiding this 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 pull request refactors the handling of MacroStmts by updating its annotation to inherit dataflow behavior from ExprBlock and adjusts related test queries accordingly.
- Updated the MacroStmts annotation to include replace_bases and cfg parameters.
- Modified the formatting of the doc string in annotations.py.
- Revised the unsafe_query_4 definition in the MySQL test to use a conditional expression for query generation.
Reviewed Changes
Copilot reviewed 13 out of 25 changed files in this pull request and generated no comments.
File | Description |
---|---|
rust/schema/annotations.py | Updated MacroStmts annotation and adjusted doc string formatting. |
rust/ql/test/query-tests/security/CWE-089/sqlx.rs | Revised unsafe_query_4 to conditionally generate the query. |
Files not reviewed (12)
- rust/downgrades/48a13c5eec3663c32ae89bb0aad8a03f52ad68c3/upgrade.properties: Language not supported
- rust/ql/.generated.list: Language not supported
- rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll: Language not supported
- rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll: Language not supported
- rust/ql/lib/codeql/rust/elements/MacroStmts.qll: Language not supported
- rust/ql/lib/rust.dbscheme: Language not supported
- rust/ql/lib/upgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties: Language not supported
- rust/ql/test/library-tests/controlflow/BasicBlocks.expected: Language not supported
- rust/ql/test/library-tests/controlflow/Cfg.expected: Language not supported
- rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected: Language not supported
- rust/ql/test/library-tests/variables/Cfg.expected: Language not supported
- rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected: Language not supported
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.
This pull request adds a dataflow step for the expression of a
MacroStmts
block.MacroStmts
nodes are inserted when a macro is expanded inside a block: for example:This pull request changes the control and data flow of
MacroStmts
to match that ofExprBlock
.Thanks to @coadaflorin for spotting this case.