Skip to content

Commit 78adcd4

Browse files
committed
JS: Fix join ordering
1 parent 6a986a9 commit 78adcd4

File tree

1 file changed

+10
-5
lines changed
  • javascript/ql/src/semmle/javascript/dataflow

1 file changed

+10
-5
lines changed

javascript/ql/src/semmle/javascript/dataflow/Nodes.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,17 @@ class ClassNode extends DataFlow::SourceNode {
715715
t.start() and
716716
result = getAReceiverNode()
717717
or
718+
result = getAnInstanceReferenceAux(t) and
719+
// Avoid tracking into the receiver of other classes.
720+
// Note that this also blocks flows into a property of the receiver,
721+
// but the `localFieldStep` rule will often compensate for this.
722+
not result = any(DataFlow::ClassNode cls).getAReceiverNode()
723+
}
724+
725+
pragma[noinline]
726+
private DataFlow::SourceNode getAnInstanceReferenceAux(DataFlow::TypeTracker t) {
718727
exists(DataFlow::TypeTracker t2 |
719-
result = getAnInstanceReference(t2).track(t2, t) and
720-
// Avoid tracking into the receiver of other classes.
721-
// Note that this also blocks flows into a property of the receiver,
722-
// but the `localFieldStep` rule will often compensate for this.
723-
not result = any(DataFlow::ClassNode cls).getAReceiverNode()
728+
result = getAnInstanceReference(t2).track(t2, t)
724729
)
725730
}
726731

0 commit comments

Comments
 (0)