- Notifications
You must be signed in to change notification settings - Fork1.7k
C++: Fix typeid IR translation#20060
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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 fixes the IR translation for C++typeid
expressions by implementing proper IR instructions for bothtypeid
with expressions andtypeid
with types. The changes address consistency issues in the IR generation wheretypeid
operations were previously not properly handled.
Key changes:
- Adds new IR instruction types
TypeidExpr
andTypeidType
with corresponding opcodes - Implements
TranslatedTypeidExpr
class to handle the translation oftypeid
operations - Updates test expectations to reflect the corrected IR generation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
File | Description |
---|---|
cpp/ql/lib/semmle/code/cpp/ir/implementation/Opcode.qll | AddsTTypeidExpr andTTypeidType opcodes with their corresponding classes |
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll | DefinesTypeidExprInstruction andTypeidTypeInstruction classes |
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll | ImplementsTranslatedTypeidExpr class for handling typeid expression translation |
Multiple .expected files | Updates test expectations to reflect the fixed IR translation |
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.
One comment, but otherwise this LGTM if DCA comes back happy!
cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
Final rounds of comments and then I think we're there 🥳
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
LGTM (once DCA comes back happy)!
It looks likes this gives a slowdown on zeek/spicy. It looks like that project uses The other projects in DCA look fine. |
MathiasVP commentedJul 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Makes sense. I think that's fine. I'm quite happy with the large reduction in Did you see that there's a large increase in |
jketema commentedJul 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, drogon also has some uses of |
Yeah, I don't think this needs to be looked at in this PR since I highly doubt that this PR does anything incorrectly. |
Ok, merging. |
200d46f
intogithub:mainUh oh!
There was an error while loading.Please reload this page.
No description provided.