Repository navigation
C++: ArrayTypes are never uninitialized - #23255
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the array data-flow modeling correction.
No open issues 🎉
What changed in this PR
This PR corrects C++ IR data-flow modeling so array values are not treated as uninitialized, while preserving the distinction between an array’s address and its potentially uninitialized contents.
Changes:
- Excludes array types from
UninitializedNode. - Adds regression cases for array and scalar addresses.
- Updates inline annotations and expected results to reflect the corrected IR behavior.
| File | Description |
|---|---|
| cpp/ql/test/library-tests/dataflow/dataflow-tests/uninitialized.expected | Adds expected AST results for the new address cases. |
| cpp/ql/test/library-tests/dataflow/dataflow-tests/test.cpp | Adds address regression cases and adjusts inline expectations. |
| cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected | Removes spurious IR array flows and records new AST results. |
| cpp/ql/test/library-tests/dataflow/dataflow-tests/clang.cpp | Updates the array-address annotation to expect AST flow only. |
| cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowNodes.qll | Excludes array types from direct uninitialized nodes. |
Review effort: Balanced (adaptive)
30 tasks
jketema
approved these changes
Nov 26, 2026
jketema
pushed a commit
to github/codeql-coding-standards
that referenced
this pull request
Nov 26, 2026
jketema
added a commit
to github/codeql-coding-standards
that referenced
this pull request
Nov 26, 2026
…nitialized-arrays C++: Fix queries after github/codeql#23255
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.
This PR removes array types from the
UninitializedNodeclass since these values are never uninitialized (what they point to may be uninitialized, but not the arrays themselves).Commit-by-commit review recommended.