mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge pull request #7187 from aschackmull/java/dont-clear-in-summary-store
Java: Don't clear content in store steps in summaries.
This commit is contained in:
@@ -150,8 +150,11 @@ 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) and
|
||||
c.(FieldContent).getField() = fa.getField()
|
||||
)
|
||||
or
|
||||
FlowSummaryImpl::Private::Steps::summaryClearsContent(n, c)
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user