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

This commit is contained in:
Anders Schack-Mulligen
2021-11-19 14:22:28 +01:00
parent 62730e7a4b
commit 2b1f34ed9b
2 changed files with 2 additions and 3 deletions

View File

@@ -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))
or
FlowSummaryImpl::Private::Steps::summaryClearsContent(n, c)
}

View File

@@ -174,7 +174,7 @@ public class A {
a1.field1 = source(20);
A a2 = new A();
applyConsumer1Field1Field2(a1, a2, p -> {
sink(p); // MISSING FLOW
sink(p); // $ flow=20
});
wrapSinkToAvoidFieldSsa(a1);
sink(a2.field2);