-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Add ComPtr
conversion operators
#20310
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
C++: Add ComPtr
conversion operators
#20310
Conversation
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 PR adds conversion operators to the ComPtr model for Microsoft WRL (Windows Runtime Library) to improve data flow tracking. The models enable tracking of taint through ComPtr operations, which is important for security analysis of Windows C++ applications.
Key changes:
- Adds new models for ComPtr assignment operators and dereference operators
- Adds ComPtrRef class models for address-of operations
- Improves taint flow detection through smart pointer conversions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
ComPtr.model.yml |
Adds assignment operator models for ComPtr including templated and move assignment operators |
ComPtrRef.model.yml |
New model file for ComPtrRef class with conversion and dereference operators |
atl.cpp |
Adds test cases for new ComPtr operators and conversion scenarios |
*.expected |
Test result updates reflecting the new models and improved taint flow detection |
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.
Looks sensible. So I'm happy if DCA is happy.
DCA was uneventful. |
This model sadly isn't complete because our MaD parsing doesn't yet support using templates in the name of the function. This is necessary for stuff like:
which happens a lot for the
ComPtrRef
class (for example here). I plan to tackle that as a follow-up and then we can add the remaining models.Commit-by-commit review recommended. I also spotted an incorrect model that I added in #20301 which I fixed in b4cc17f (and Copilot spotted even more stuff like that which I fixed in b9cd7a8). Generally, it's always a bug to have an occurrence of
@
in the input column, but not in the output column (or vice versa) of a value-preserving summary since that would correspond to some kind of conflation.