-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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++: Implement proper coroutine support in IR #16301
C++: Implement proper coroutine support in IR #16301
Conversation
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll
Dismissed
Show dismissed
Hide dismissed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll
Dismissed
Show dismissed
Hide dismissed
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll
Outdated
Show resolved
Hide resolved
Co-authored-by: Jeroen Ketema <[email protected]>
tag = ResultCopyTag() and result = "ResultCopy" | ||
or |
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.
This was a drive-by fix I did while debugging. This tag didn't have a result previously.
I think this is related to the issue I reported to our frontend provider (but let me double check that). |
Awesome. That will save me half a morning of debugging then 🎉 |
Yeah, those are exactly the local variables that we filed an issue for with our frontend provider. If these are not causing any serious problems, I propose with just add a comment to the open issue on this that once we receive a patch we should also fix this (if that's not automatic). |
One question: how do the translations of the reuse expression look (they are a bit hard to find)? In the intermediate state we had before this PR, the use and reuse we in separate blocks. Is that solved now? |
Ah, they still seem to be in different blocks, but the order of the blocks seems such that we get something that is initialised. |
Indeed. It seems like the frontend is doing sensible things here 🎉 |
I would expect this to be fixed automagically, but let's note it in the internal issue anyway 👍 |
Added. |
This PR fixes the IR generation for
co_await
andco_yield
. We added IR support for these in #16187. However, we didn't quite capture the right semantics of the constructs. This PR fixes this by generating the (hopefully) correct semantics by making use of the children ofco_await
andco_yield
as emitted by our frontend.This gets rid of all the dead ends in the IR. I haven't quite figured out why we get new
nonUniqueIRVariable
inconsistencies, though (and whether this is a QL or extractor bug).