Skip to content

Commit e9322f4

Browse files
authored
Merge pull request #22249 from MathiasVP/python-explicit-fasttc-local-flow-step
Python: Use fastTC explicitly in `localFlow`
2 parents cee85c1 + d2faab7 commit e9322f4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowUtil.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ predicate localFlowStep(Node nodeFrom, Node nodeTo) {
2020
FlowSummaryImpl::Private::Steps::summaryThroughStepValue(nodeFrom, nodeTo, _)
2121
}
2222

23+
private predicate localFlowStepPlus(Node node1, Node node2) = fastTC(localFlowStep/2)(node1, node2)
24+
2325
/**
2426
* Holds if data flows from `source` to `sink` in zero or more local
2527
* (intra-procedural) steps.
2628
*/
2729
pragma[inline]
28-
predicate localFlow(Node source, Node sink) { localFlowStep*(source, sink) }
30+
predicate localFlow(Node source, Node sink) { source = sink or localFlowStepPlus(source, sink) }

0 commit comments

Comments
 (0)