Skip to content

Commit 1dc712f

Browse files
authored
Merge pull request github#6629 from tamasvajk/feature/dispatch-fix
C#: Fix dispatch library to handle summarized callables with no runti…
2 parents 7befdc9 + 648197d commit 1dc712f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowDispatch.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ private import FlowSummaryImpl as FlowSummaryImpl
88
private import semmle.code.csharp.dataflow.FlowSummary
99
private import semmle.code.csharp.dataflow.ExternalFlow
1010
private import semmle.code.csharp.dispatch.Dispatch
11+
private import semmle.code.csharp.dispatch.RuntimeCallable
1112
private import semmle.code.csharp.frameworks.system.Collections
1213
private import semmle.code.csharp.frameworks.system.collections.Generic
1314

@@ -275,6 +276,10 @@ class NonDelegateDataFlowCall extends DataFlowCall, TNonDelegateCall {
275276

276277
override DataFlowCallable getARuntimeTarget() {
277278
result = getCallableForDataFlow(dc.getADynamicTarget())
279+
or
280+
result = dc.getAStaticTarget().getUnboundDeclaration() and
281+
summarizedCallable(result) and
282+
not result instanceof RuntimeCallable
278283
}
279284

280285
override ControlFlow::Nodes::ElementNode getControlFlowNode() { result = cfn }

0 commit comments

Comments
 (0)