-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: flow through output iterators with user-defined operator= and operator* #4468
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.
LGTM apart from a few small comments!
jbj
left a comment
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.
Otherwise LGTM
| this.hasName(["front_inserter", "inserter", "back_inserter"]) and | ||
| this.getNamespace().hasName("std") |
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.
Why not use hasQualifiedName("std", [...])?
| *i14++ = source(); | ||
| sink(v14); // tainted [NOT DETECTED by IR] |
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.
I'd like to see some prefix-++ and some -- too.
This reverts commit 28fa266.
|
I've rewritten most of the QL changes. It now works with just the previously existing nodes and some additional flow edges to the return value input for |
jbj
left a comment
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.
Thanks for making these changes! The code looks much better now that the library-specific details have been moved into the model classes. I have a few more review comments.
Co-authored-by: Jonas Jensen <[email protected]>
jbj
left a comment
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 PR LGTM with the latest round of changes. The test failures are caused by semantic merge conflicts with #4471.
Accept test changes for unnamed elements
|
I've started https://jenkins.internal.semmle.com/job/Changes/job/CPP-Differences/1511/. Feel free to self-merge if there are no performance or result regressions. |
|
@rdmarsh2 The slowdowns on Linux and Kamailio are too big to ignore, so please investigate. They occur in queries that don't use data flow, so perhaps they're inside the models library. |
Resolve merge conflict in tests
jbj
left a comment
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.
The re-run of CPP-Differences doesn't have the same performance outliers, so perhaps it was just noise.


This PR adds general flow through
operator*inAddressFlow.qllandFlowVar.qll, and adds iterator-specific flow throughoperator=inDataFlowUtil.qll. Those combine to support flow through iterators returned by thestd::back_inserterfunction.A few existing tests are affected by the
operator*changes. I think those are mostly positive.