@@ -94,6 +94,8 @@ private import FlowSummaryImpl::Public
94
94
private import FlowSummaryImpl:: Private
95
95
private import FlowSummaryImpl:: Private:: External
96
96
private import semmle.code.csharp.commons.QualifiedName
97
+ private import semmle.code.csharp.dispatch.OverridableCallable
98
+ private import semmle.code.csharp.frameworks.System
97
99
private import codeql.mad.ModelValidation as SharedModelVal
98
100
99
101
private predicate relevantNamespace ( string namespace ) {
@@ -442,20 +444,16 @@ predicate sourceNode(Node node, string kind) { sourceNode(node, kind, _) }
442
444
*/
443
445
predicate sinkNode ( Node node , string kind ) { sinkNode ( node , kind , _) }
444
446
445
- /** Holds if the summary should apply for all overrides of `c`. */
446
- predicate isBaseCallableOrPrototype ( UnboundCallable c ) {
447
- c .getDeclaringType ( ) instanceof Interface
448
- or
449
- exists ( Modifiable m | m = [ c .( Modifiable ) , c .( Accessor ) .getDeclaration ( ) ] |
450
- m .isAbstract ( )
451
- or
452
- c .getDeclaringType ( ) .( Modifiable ) .isAbstract ( ) and m .( Virtualizable ) .isVirtual ( )
447
+ private predicate isOverridableCallable ( OverridableCallable c ) {
448
+ not exists ( Type t , Callable base | c .getOverridee + ( ) = base and t = base .getDeclaringType ( ) |
449
+ t instanceof SystemObjectClass or
450
+ t instanceof SystemValueTypeClass
453
451
)
454
452
}
455
453
456
454
/** Gets a string representing whether the summary should apply for all overrides of `c`. */
457
455
private string getCallableOverride ( UnboundCallable c ) {
458
- if isBaseCallableOrPrototype ( c ) then result = "true" else result = "false"
456
+ if isOverridableCallable ( c ) then result = "true" else result = "false"
459
457
}
460
458
461
459
private module QualifiedNameInput implements QualifiedNameInputSig {
0 commit comments