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 {
357357 }
358358}
359359
360- private class UnboundCallable extends Callable {
360+ /** An unbound callable. */
361+ class UnboundCallable extends Callable {
361362 UnboundCallable ( ) { this .isUnboundDeclaration ( ) }
362363
364+ /**
365+ * Holds if this unbound callable overrides or implements (transitively)
366+ * `that` unbound callable.
367+ */
363368 predicate overridesOrImplementsUnbound ( UnboundCallable that ) {
364369 exists ( Callable c |
365370 this .( Virtualizable ) .overridesOrImplementsOrEquals ( c ) or
Original file line number Diff line number Diff line change 11import shared.FlowSummaries
2+ private import semmle.code.csharp.dataflow.ExternalFlow
23
34class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable {
45 IncludeFilteredSummarizedCallable ( ) { this instanceof SummarizedCallable }
@@ -14,8 +15,8 @@ class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable {
1415 this .propagatesFlow ( input , output , preservesValue ) and
1516 not exists ( IncludeSummarizedCallable rsc |
1617 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 )
1920 )
2021 }
2122}
Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
2020 predicate isBaseCallableOrPrototype ( ) {
2121 this .getDeclaringType ( ) instanceof Interface
2222 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+ )
2628 }
2729
2830 /** 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