mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Fix dispatch library to handle summarized callables with no runtime target
This commit is contained in:
@@ -8,6 +8,7 @@ private import FlowSummaryImpl as FlowSummaryImpl
|
||||
private import semmle.code.csharp.dataflow.FlowSummary
|
||||
private import semmle.code.csharp.dataflow.ExternalFlow
|
||||
private import semmle.code.csharp.dispatch.Dispatch
|
||||
private import semmle.code.csharp.dispatch.RuntimeCallable
|
||||
private import semmle.code.csharp.frameworks.system.Collections
|
||||
private import semmle.code.csharp.frameworks.system.collections.Generic
|
||||
|
||||
@@ -275,6 +276,10 @@ class NonDelegateDataFlowCall extends DataFlowCall, TNonDelegateCall {
|
||||
|
||||
override DataFlowCallable getARuntimeTarget() {
|
||||
result = getCallableForDataFlow(dc.getADynamicTarget())
|
||||
or
|
||||
result = dc.getAStaticTarget().getUnboundDeclaration() and
|
||||
summarizedCallable(result) and
|
||||
not result instanceof RuntimeCallable
|
||||
}
|
||||
|
||||
override ControlFlow::Nodes::ElementNode getControlFlowNode() { result = cfn }
|
||||
|
||||
Reference in New Issue
Block a user