-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Fix IR variable reuse for global var inits #8912
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
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.
Found 1 vulnerability.
This comment was marked as outdated.
This comment was marked as outdated.
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.
Found 1 vulnerability.
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 as long as the tests pass.
I fixed the test regressions caused by running against the old frontend. However, it turns out, also some syntax zoo tests broke (unrelated to the frontend). I could update those, but I cannot tell if the changes are correct. Also the IR
This becomes:
Which |
37fb227
to
fe52dd9
Compare
Fixed by d1c6022 |
Thanks. Would it be possible to add |
Good call - I've added the test and fixed another case of missing variables |
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.
Found 9 vulnerabilities.
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedGlobalVar.qll
Fixed
Show fixed
Hide fixed
/** | ||
* Represents the IR translation of a root element, either a function or a global variable. | ||
*/ |
Check warning
Code scanning / CodeQL
Class QLDoc style.
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.
Found 1 vulnerability.
result = this.getInstruction(InitializerVariableAddressTag()) | ||
or | ||
tag = InitializerVariableAddressTag() and | ||
result = getChild(1).getFirstInstruction() |
Check warning
Code scanning / CodeQL
Using implicit `this`
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.
Everything LGTM! Do we need to rerun DCA? I don't think much has changed apart from a merge-from-main and accepting some test changes, right?
I don't think we do... My only worry would be how much change there's been to main in the meantime, but there hasn't been much else happening on the C++ dataflow side |
Fixes a performance issue where all
IRVariable
s corresponding to a given global variable were being used in the initializer IRFunction for that global variable.