Skip to content

Commit 648197d

Browse files
committed
C#: Fix dispatch library to handle summarized callables with no runtime target
1 parent 5a47ddb commit 648197d

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)