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
7
7
private import semmle.code.csharp.commons.Collections as Collections
8
8
private import semmle.code.csharp.dataflow.internal.DataFlowDispatch
9
9
private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
10
+ private import semmle.code.csharp.dispatch.OverridableCallable
10
11
private import semmle.code.csharp.frameworks.system.linq.Expressions
11
12
private import semmle.code.csharp.frameworks.System
12
13
import semmle.code.csharp.dataflow.internal.ExternalFlow as ExternalFlow
@@ -130,7 +131,13 @@ class SinkTargetApi extends SourceOrSinkTargetApi {
130
131
* A class of callables that are potentially relevant for generating source models.
131
132
*/
132
133
class 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
+ }
134
141
}
135
142
136
143
/**
You can’t perform that action at this time.
0 commit comments