Skip to content

C++: Remove noise from argHasPostUpdate check #3162

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 2 commits into from
Mar 30, 2020

Conversation

jbj
Copy link
Contributor

@jbj jbj commented Mar 30, 2020

This consistency check seems to have value for AST data flow, but I've disabled it on the IR for now.

This PR also includes two unrelated changes that seem to fix a semantic merge conflict.

This consistency check seems to have value for AST data flow, but I've
disabled it on the IR for now.

This commit also includes two unrelated changes that seem to fix a
semantic merge conflict.
@jbj jbj added the C++ label Mar 30, 2020
@jbj jbj requested a review from a team as a code owner March 30, 2020 13:54
missingToString
| Nodes without toString: 1 |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know where these changes came from. I'm guessing they are a semantic merge conflict with #2921 because it was merged with expected files that are 19 days old.

Copy link
Contributor

@rdmarsh2 rdmarsh2 left a comment

Choose a reason for hiding this comment

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

LGTM

@rdmarsh2 rdmarsh2 merged commit 4bbf462 into github:master Mar 30, 2020
)
or
// Isn't something we can track
n.asExpr() instanceof Call
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend against this line. Presumably a Call can be a getter, in which case you'd want a postupdatenode to allow a backwards store step. E.g. in

funcWithFlowFromArg0toArg1(source(), objWithFooField.getFoo());

you'd want flow to reach objWithFooField with an access path of [.foo].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. But if these are consistency queries, then I'd expect their results to show me nodes that are unexpectedly missing. A node for objWithFooField is missing because the AST data flow isn't feature-complete, but that doesn't mean it's inconsistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is the call to .getFoo() that may or may not be missing (we're looking at something that's both a call and an argument), and this line suppresses information about such missing postupdatenodes. If a call in an argument position is missing a postupdatenode and that call has the potential to be a getter, then I think that's definitely an unexpected missing postupdatenode, so I don't think it's a good idea to blanket-filter all calls here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the feature to get this particular flow step working is implemented completely in the shared library as long as sufficient postupdatenodes are present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the clarification. I'll try to add the relevant post-update nodes.

jbj added a commit to jbj/ql that referenced this pull request Apr 30, 2020
jbj added a commit to jbj/ql that referenced this pull request May 1, 2020
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.

3 participants