Skip to content

Commit 96aa182

Browse files
committed
Data flow: Cache jumpStep
1 parent 8bfeae7 commit 96aa182

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private predicate additionalLocalFlowStep(Node node1, Node node2, Configuration
234234
* Holds if data can flow from `node1` to `node2` in a way that discards call contexts.
235235
*/
236236
private predicate jumpStep(Node node1, Node node2, Configuration config) {
237-
jumpStep(node1, node2) and
237+
jumpStepCached(node1, node2) and
238238
not outBarrier(node1, config) and
239239
not inBarrier(node2, config) and
240240
not fullBarrier(node1, config) and

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private module LambdaFlow {
160160
toJump = true and
161161
lastCall = TDataFlowCallNone()
162162
|
163-
jumpStep(node, mid) and
163+
jumpStepCached(node, mid) and
164164
t = t0
165165
or
166166
exists(boolean preservesValue |
@@ -253,6 +253,9 @@ private module Cached {
253253
cached
254254
predicate nodeDataFlowType(Node n, DataFlowType t) { t = getNodeType(n) }
255255

256+
cached
257+
predicate jumpStepCached(Node node1, Node node2) { jumpStep(node1, node2) }
258+
256259
/**
257260
* Gets a viable target for the lambda call `call`.
258261
*

0 commit comments

Comments
 (0)