File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
csharp/ql/src/utils/modelgenerator/internal Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ private import semmle.code.csharp.commons.Util as Util
77private import semmle.code.csharp.commons.Collections as Collections
88private import semmle.code.csharp.dataflow.internal.DataFlowDispatch
99private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
10+ private import semmle.code.csharp.dispatch.OverridableCallable
1011private import semmle.code.csharp.frameworks.system.linq.Expressions
1112private import semmle.code.csharp.frameworks.System
1213import semmle.code.csharp.dataflow.internal.ExternalFlow as ExternalFlow
@@ -130,7 +131,13 @@ class SinkTargetApi extends SourceOrSinkTargetApi {
130131 * A class of callables that are potentially relevant for generating source models.
131132 */
132133class SourceTargetApi extends SourceOrSinkTargetApi {
133- SourceTargetApi ( ) { not hasManualSourceModel ( this ) }
134+ SourceTargetApi ( ) {
135+ not hasManualSourceModel ( this ) and
136+ // Do not generate source models for overridable callables
137+ // as virtual dispatch implies that too many methods
138+ // will be considered sources.
139+ not this .( Overridable ) .overridesOrImplements ( _)
140+ }
134141}
135142
136143/**
You can’t perform that action at this time.
0 commit comments