C++: mass-enable diff-informed queries phase 2 - getASelected{Source,Sink}Location() { none() }#19759
Merged
d10c merged 1 commit intogithub:mainfrom Jun 19, 2025
Merged
Conversation
fa3a2b0 to
41cf298
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Enables diff-informed incremental mode by adding a required stub predicate across data-flow and taint-tracking configurations, and overrides the source-location selection for one query.
- Mass-add
predicate observeDiffInformedIncrementalMode() { any() }to various modules - Add
getASelectedSourceLocation(DataFlow::Node) { none() }override in WordexpTainted
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cpp/ql/src/experimental/Security/CWE/CWE-190/AllocMultiplicationOverflow.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.ql | Added observeDiffInformedIncrementalMode stub and source-location override |
| cpp/ql/src/Security/CWE/CWE-611/XXE.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Security/CWE/CWE-497/PotentiallyExposedSystemData.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Security/CWE/CWE-190/IntegerOverflowTainted.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Security/CWE/CWE-129/ImproperArrayIndexValidation.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Security/CWE/CWE-114/UncontrolledProcessOperation.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Likely Bugs/Memory Management/NtohlArrayNoBound.qll | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql | Added stub observeDiffInformedIncrementalMode |
| cpp/ql/lib/experimental/semmle/code/cpp/security/PrivateCleartextWrite.qll | Added stub observeDiffInformedIncrementalMode |
Comments suppressed due to low confidence (1)
cpp/ql/src/experimental/Security/CWE/CWE-190/AllocMultiplicationOverflow.ql:34
- No tests have been added to validate diff-informed incremental mode. Consider adding unit tests or query tests to ensure observeDiffInformedIncrementalMode() stubs behave as expected.
predicate observeDiffInformedIncrementalMode() { any() }
| node.asExpr() = any(HeuristicAllocationExpr ae).getSizeExpr().getAChild*() | ||
| } | ||
|
|
||
| predicate observeDiffInformedIncrementalMode() { any() } |
There was a problem hiding this comment.
The identical stub predicate observeDiffInformedIncrementalMode() is added across many modules. Consider defining a default implementation or mixin to reduce duplication and ease future updates.
Suggested change
| predicate observeDiffInformedIncrementalMode() { any() } | |
| import CommonConfig |
41cf298 to
2316b8c
Compare
This was referenced Jul 16, 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.
Stacks on top of earlier PR: #19659
Uses patch from: https://github.com/github/codeql-patch/pull/88/commits/ec5681e740c18c792443099fb3e413446616a0ee
Adds
getASelected{Source,Sink}Location() { none() }override to a query that selects a dataflow source or sink as a location, but not both.