C#: Revert change to getASummarizedCallableTarget

This commit is contained in:
Tom Hvitved
2026-01-21 12:32:48 +01:00
parent 0f6bae0ae1
commit 732c60c07c

View File

@@ -371,9 +371,21 @@ class NonDelegateDataFlowCall extends DataFlowCall, TNonDelegateCall {
/** Gets the underlying call. */
DispatchCall getDispatchCall() { result = dc }
pragma[nomagic]
private predicate hasSourceTarget() { dc.getAStaticTarget().fromSource() }
pragma[nomagic]
private FlowSummary::SummarizedCallable getASummarizedCallableTarget() {
result = this.getATarget(_)
// Only use summarized callables with generated summaries in case
// we are not able to dispatch to a source declaration.
exists(boolean static |
result = this.getATarget(static) and
if this.hasSourceTarget() then result.hasManualModel() else any()
|
static = false
or
static = true and not result instanceof RuntimeCallable
)
}
pragma[nomagic]