Skip to content

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

Merged
aschackmull merged 2 commits intogithub:mainfrom
aschackmull:java/dont-clear-in-summary-store
Nov 19, 2021
Merged

Java: Don't clear content in store steps in summaries.#7187
aschackmull merged 2 commits intogithub:mainfrom
aschackmull:java/dont-clear-in-summary-store

Conversation

@aschackmull
Copy link
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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