Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The expanded global value numbering match still awaits the planned performance validation.
Review effort: Balanced
Findings: None
What changed in this PR
Reduces false positives in C++ destructor resource-release analysis by recognizing resources released through local aliases.
Changes:
- Uses global value numbering to match released expressions.
- Adds alias regression tests, including an overwritten alias that must still trigger an alert.
- Updates expectations and documents the improvement.
| File | Description |
|---|---|
cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 79/TemplateDestructor.cpp |
Adds template, non-template, and overwritten-alias tests. |
cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 79/ListDelete.cpp |
Removes the false-positive annotation from a test comment. |
cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 79/AV Rule 79.expected |
Updates expected alerts. |
cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql |
Matches releases through value-equivalent expressions. |
cpp/ql/src/change-notes/2026-10-06-resource-release-aliases.md |
Documents reduced false positives. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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.
Fix false positives for
cpp/resource-not-released-in-destructor, using global value numbering.This is largely Copilot's work. I have reviewed and tested with MRVA. I will be checking performance with DCA, as that can be an issue with GVN, though in this case GVN was already present in one of the other branches so I am optimistic.