File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
lib/semmle/code/csharp/dataflow
library-tests/dataflow/library Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -357,9 +357,14 @@ private class UnboundValueOrRefType extends ValueOrRefType {
357
357
}
358
358
}
359
359
360
- private class UnboundCallable extends Callable {
360
+ /** An unbound callable. */
361
+ class UnboundCallable extends Callable {
361
362
UnboundCallable ( ) { this .isUnboundDeclaration ( ) }
362
363
364
+ /**
365
+ * Holds if this unbound callable overrides or implements (transitively)
366
+ * `that` unbound callable.
367
+ */
363
368
predicate overridesOrImplementsUnbound ( UnboundCallable that ) {
364
369
exists ( Callable c |
365
370
this .( Virtualizable ) .overridesOrImplementsOrEquals ( c ) or
Original file line number Diff line number Diff line change 1
1
import shared.FlowSummaries
2
+ private import semmle.code.csharp.dataflow.ExternalFlow
2
3
3
4
class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable {
4
5
IncludeFilteredSummarizedCallable ( ) { this instanceof SummarizedCallable }
@@ -14,8 +15,8 @@ class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable {
14
15
this .propagatesFlow ( input , output , preservesValue ) and
15
16
not exists ( IncludeSummarizedCallable rsc |
16
17
rsc .isBaseCallableOrPrototype ( ) and
17
- this . ( Virtualizable ) . overridesOrImplements ( rsc ) and
18
- rsc . propagatesFlow ( input , output , preservesValue )
18
+ rsc . propagatesFlow ( input , output , preservesValue ) and
19
+ this . ( UnboundCallable ) . overridesOrImplementsUnbound ( rsc )
19
20
)
20
21
}
21
22
}
Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
20
20
predicate isBaseCallableOrPrototype ( ) {
21
21
this .getDeclaringType ( ) instanceof Interface
22
22
or
23
- this .( Modifiable ) .isAbstract ( )
24
- or
25
- this .getDeclaringType ( ) .( Modifiable ) .isAbstract ( ) and this .( Virtualizable ) .isVirtual ( )
23
+ exists ( Modifiable m | m = [ this .( Modifiable ) , this .( Accessor ) .getDeclaration ( ) ] |
24
+ m .isAbstract ( )
25
+ or
26
+ this .getDeclaringType ( ) .( Modifiable ) .isAbstract ( ) and m .( Virtualizable ) .isVirtual ( )
27
+ )
26
28
}
27
29
28
30
/** Gets a string representing, whether the summary should apply for all overrides of this. */
You can’t perform that action at this time.
0 commit comments