-
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++: Make swap member functions data-flow functions #17351
Conversation
@@ -68,7 +68,7 @@ void test_pair() | |||
i.swap(j); | |||
k.swap(l); | |||
sink(i.first); | |||
sink(i.second); // $ MISSING: ast,ir | |||
sink(i.second); // $ ir, MISSING: ast |
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 shows that the change is doing what we want for the IR based taint tracking.
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, but it looks like you still need to accept changes to some other tests to get CI passing.
I've figured out why we loose some of the edges in the AST-based taint tracking. It turns out that some cases related to member functions are handled for I've quickly tried adding some of these extra cases for |
ff236f1
to
9ae16be
Compare
9ae16be
to
f066f21
Compare
cpp/ql/test/library-tests/dataflow/dataflow-tests/test-source-sink.expected
Show resolved
Hide resolved
Since the library is deprecated we should no longer use it in any of our queries, so there should be no ramifications on results in our query suites and I think no ramifications on performance either. It could well affect users who are still using the deprecated libraries though. We generally expect users to move away from deprecated libraries within 1 year at which point we delete them. I agree it probably isn't worth fixing, though I'm not strongly against it if you want to. |
Makes sense.
Let's keep it as is then 👍 |
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 force-push made this a little harder to re-review than it should have been, but LGTM.
Thanks for the review and sorry about force pushing. I was thinking that as the PR was previously marked as a draft I could get away with it. But it makes sense to not do that given that you'd already reviewed 👍 |
This PR makes
swap
member functionsDataFlowFunction
s instead ofTaintFunction
s.This causes some good results in the AST based taint tracking to disappear. We'll have to do some more investigation to figure out why that is the case. I've not updated the tests to expect this regression, so CI will fail.