-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
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.
missingToString | ||
| Nodes without toString: 1 | |
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 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.
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
) | ||
or | ||
// Isn't something we can track | ||
n.asExpr() instanceof Call |
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 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]
.
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.
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.
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.
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.
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.
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.
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 the clarification. I'll try to add the relevant post-update nodes.
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.