Skip to content

Commit f229566

Browse files
authored
Merge pull request #22717 from hvitved/unified/derived-read-store-step-multi-join
Unified: Join on both `name` and `namespace` in `derivedStoreReadStep`
2 parents 8cebd55 + f09618a commit f229566

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/StaticNameBinding.qll‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,19 @@ module Track<TrackInputSig Input> {
335335
}
336336
}
337337

338+
pragma[nomagic]
339+
private predicate derivedStoreReadStep0(NamespaceNode namespace, string name, NameBindingNode node2) {
340+
readStep(namespace.ref(), pragma[only_bind_into](name), node2)
341+
}
342+
338343
/**
339344
* Holds if `node1 -> node2` is derived by combining a store and a read step, with zero or more value steps and inheritance steps in-between.
340345
*/
341346
pragma[nomagic]
342347
private predicate derivedStoreReadStep(NameBindingNode node1, NameBindingNode node2) {
343348
exists(NamespaceNode namespace, string name |
344-
node1 = namespace.getMember(pragma[only_bind_into](name)) and // getMember() combines a store step with subsequent inheritance steps
345-
readStep(namespace.ref(), pragma[only_bind_into](name), node2) and
349+
node1 = namespace.getMember(name) and // getMember() combines a store step with subsequent inheritance steps
350+
derivedStoreReadStep0(namespace, name, node2) and
346351
node1 != node2
347352
)
348353
}

0 commit comments

Comments
 (0)