@@ -1207,12 +1207,25 @@ private predicate onPath(DataFlow::Node nd, DataFlow::Configuration cfg, PathSum
12071207 not cfg .isLabeledBarrier ( nd , summary .getEndLabel ( ) )
12081208 or
12091209 exists ( DataFlow:: Node mid , PathSummary stepSummary |
1210- reachableFromSource ( nd , cfg , summary ) and
1211- flowStep ( nd , id ( cfg ) , mid , stepSummary ) and
1210+ onPathStep ( nd , cfg , summary , stepSummary , mid ) and
12121211 onPath ( mid , id ( cfg ) , summary .append ( stepSummary ) )
12131212 )
12141213}
12151214
1215+ /**
1216+ * Holds if `nd` can be reached from a source under `cfg`,
1217+ * and there is a flowStep from `nd` (with summary `summary`) to `mid` (with summary `stepSummary`).
1218+ *
1219+ * This predicate has been outlined from `onPath` to give the optimizer a hint about join-ordering.
1220+ */
1221+ private predicate onPathStep (
1222+ DataFlow:: Node nd , DataFlow:: Configuration cfg , PathSummary summary , PathSummary stepSummary ,
1223+ DataFlow:: Node mid
1224+ ) {
1225+ reachableFromSource ( nd , cfg , summary ) and
1226+ flowStep ( nd , id ( cfg ) , mid , stepSummary )
1227+ }
1228+
12161229/**
12171230 * Holds if there is a configuration that has at least one source and at least one sink.
12181231 */
0 commit comments