Skip to content

Java: Don't clear content in store steps in summaries. #7187

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
Nov 19, 2021

Conversation

aschackmull
Copy link
Contributor

Store steps in summaries aren't likely to be intended to clear the targeted content (also, this currently doesn't even work consistently). This caused false negative flow for any field-of-argument-to-callback summary as these summaries simply didn't work.

This fix could alternatively have been achieved by changing the synthesised read-/store-steps such that more store steps would be inferred as side-effects through reverse reads, but that seemed unnecessarily complicated.

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Nov 19, 2021
@aschackmull aschackmull requested a review from a team as a code owner November 19, 2021 13:29
@github-actions github-actions bot added the Java label Nov 19, 2021
hvitved
hvitved previously approved these changes Nov 19, 2021
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -150,8 +150,7 @@ predicate readStep(Node node1, Content f, Node node2) {
* in `x.f = newValue`.
*/
predicate clearsContent(Node n, Content c) {
c instanceof FieldContent and
n = any(PostUpdateNode pun | storeStep(_, c, pun)).getPreUpdateNode()
exists(FieldAccess fa | instanceFieldAssign(_, fa) and n = getFieldQualifier(fa))
Copy link
Contributor

@atorralba atorralba Nov 19, 2021

Choose a reason for hiding this comment

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

OOC: Isn't a problem that c is now unbound here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good spot!

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 catch. That's a bug.

@aschackmull aschackmull merged commit 344f7bc into github:main Nov 19, 2021
@aschackmull aschackmull deleted the java/dont-clear-in-summary-store branch November 19, 2021 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants