Skip to content

Commit 748625c

Browse files
committed
DataFlow: Add a predicate for modifying which dataflow steps participate in flow-through summaries.
1 parent 5917d99 commit 748625c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

shared/dataflow/codeql/dataflow/DataFlow.qll

+7
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ signature module InputSig {
170170

171171
predicate simpleLocalFlowStep(Node node1, Node node2);
172172

173+
/**
174+
* Holds if the data flow step from `node1` to `node2` can be used when
175+
* computing flow-through summaries.
176+
*/
177+
bindingset[node1, node2]
178+
default predicate flowThroughStepAllowed(Node node1, Node node2) { any() }
179+
173180
/**
174181
* Holds if data can flow from `node1` to `node2` through a non-local step
175182
* that does not follow a call edge. For example, a step through a global

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

+4-2
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,8 @@ module MakeImplCommon<InputSig Lang> {
551551
// local flow
552552
exists(Node mid |
553553
parameterValueFlowCand(p, mid, read) and
554-
simpleLocalFlowStep(mid, node)
554+
simpleLocalFlowStep(mid, node) and
555+
flowThroughStepAllowed(mid, node)
555556
)
556557
or
557558
// read
@@ -670,7 +671,8 @@ module MakeImplCommon<InputSig Lang> {
670671
// local flow
671672
exists(Node mid |
672673
parameterValueFlow(p, mid, read) and
673-
simpleLocalFlowStep(mid, node)
674+
simpleLocalFlowStep(mid, node) and
675+
flowThroughStepAllowed(mid, node)
674676
)
675677
or
676678
// read

0 commit comments

Comments
 (0)