File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
csharp/ql/lib/semmle/code/csharp/dataflow/internal Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2080,6 +2080,16 @@ class CaptureNode extends NodeImpl, TCaptureNode {
2080
2080
override string toStringImpl ( ) { result = cn .toString ( ) }
2081
2081
}
2082
2082
2083
+ /**
2084
+ * Holds if a property has accessors declared in multiple locations, and where
2085
+ * all accessors have at least one declaration without a body.
2086
+ * This can happen if both a "real" and a "stub" implementation is included in the
2087
+ * same database (which is the case for .NET Runtime).
2088
+ */
2089
+ private predicate hasAutoImplementation ( Property p ) {
2090
+ forall ( Accessor a | a = p .getAnAccessor ( ) | count ( getASourceLocation ( a ) ) > count ( a .getBody ( ) ) )
2091
+ }
2092
+
2083
2093
/** A field or a property. */
2084
2094
class FieldOrProperty extends Assignable , Modifiable {
2085
2095
FieldOrProperty ( ) {
@@ -2100,6 +2110,8 @@ class FieldOrProperty extends Assignable, Modifiable {
2100
2110
p .isAutoImplementedReadOnly ( )
2101
2111
or
2102
2112
p .getDeclaringType ( ) instanceof AnonymousClass
2113
+ or
2114
+ hasAutoImplementation ( p )
2103
2115
)
2104
2116
or
2105
2117
p .fromLibrary ( )
You can’t perform that action at this time.
0 commit comments