Skip to content

C++: Fix flow out of this by reference #1900

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

Merged
merged 3 commits into from
Sep 9, 2019

Conversation

jbj
Copy link
Contributor

@jbj jbj commented Sep 9, 2019

This PR adds a type of post-update node that allows data flow out of a this pointer passed by reference. This was missing because there is no VariableAccess associated with it, and so it didn't fit into DefinitionByReferenceNode.

There's a false negative in one of the tests I'm adding. This will be fixed by #1884.

I tested performance on MySQL, and it was fine.

@jbj jbj added the C++ label Sep 9, 2019
@jbj jbj requested a review from geoffw0 September 9, 2019 08:12
@jbj jbj requested a review from a team as a code owner September 9, 2019 08:12
jbj added 3 commits September 9, 2019 10:34
This class is undocumented and exposes implementation details through
its `getPartialDefinition` member. It does not need to be public.
The `test_nonMemberSetA` also shows how the lack of flow through `&` is
a problem for non-member getters, but that's addressed on a separate
branch.
@jbj jbj force-pushed the dataflow-this-by-ref branch from 3b538bd to 10b6935 Compare September 9, 2019 08:37
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

This was missing because there is no VariableAccess associated with it, and so it didn't fit into DefinitionByReferenceNode.

I can't help but get the feeling there are still holes. The one that springs to mind is an array access (call(callbacks[index])) but I guess TPartialDefinitionNode should cover that case.

@jbj
Copy link
Contributor Author

jbj commented Sep 9, 2019

Yes, there are still gaps in the coverage of this library. But this gap is actually the last one on my list of language-level problems I want to address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants