Skip to content

Commit e8bb7f2

Browse files
committed
C#: Fix for performance.
1 parent f7b4985 commit e8bb7f2

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

csharp/ql/src/semmle/code/csharp/dataflow/DataFlow.qll

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,15 +1094,20 @@ module DataFlow {
10941094
flowThroughCallableLibraryOutRef(_, pred, succ, true)
10951095
}
10961096

1097+
pragma[noinline]
1098+
private predicate localFlowStep0(Node pred, Node succ, Configuration config, Callable c) {
1099+
config.isAdditionalFlowStep(pred, succ) and
1100+
pred.getEnclosingCallable() = c
1101+
}
1102+
10971103
/**
10981104
* Holds if data may flow in one local step from `pred` to `succ`.
10991105
*/
11001106
bindingset[config]
11011107
predicate localFlowStep(Node pred, Node succ, Configuration config) {
11021108
localFlowStepNoConfig(pred, succ)
11031109
or
1104-
config.isAdditionalFlowStep(pred, succ) and
1105-
pred.getEnclosingCallable() = succ.getEnclosingCallable()
1110+
localFlowStep0(pred, succ, config, succ.getEnclosingCallable())
11061111
}
11071112

11081113
/**
@@ -1587,9 +1592,7 @@ module DataFlow {
15871592
/**
15881593
* A data flow context describing flow into a callable via a call argument.
15891594
*/
1590-
abstract private class ArgumentContext extends Context {
1591-
abstract DotNet::Expr getCall();
1592-
}
1595+
abstract private class ArgumentContext extends Context { abstract DotNet::Expr getCall(); }
15931596

15941597
/**
15951598
* A data flow context describing flow into a callable via an explicit call argument.

0 commit comments

Comments
 (0)