File tree Expand file tree Collapse file tree 2 files changed +35
-6
lines changed
csharp/ql/test/library-tests/dataflow/external-models Expand file tree Collapse file tree 2 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ void Foo()
12
12
13
13
object fieldWrite = new object ( ) ;
14
14
TaggedField = fieldWrite ;
15
+
16
+ object propertyWrite = new object ( ) ;
17
+ TaggedPropertySetter = propertyWrite ;
18
+
19
+ object indexerWrite = new object ( ) ;
20
+ this [ 0 ] = indexerWrite ;
15
21
}
16
22
17
23
object SinkMethod ( )
@@ -34,7 +40,21 @@ void TaggedSinkMethod(object x) { }
34
40
35
41
[ SinkAttribute ]
36
42
object TaggedField ;
43
+
44
+ [ SinkPropertyAttribute ]
45
+ object TaggedPropertySetter { get ; set ; }
46
+
47
+ [ SinkIndexerAttribute ]
48
+ object this [ int index ]
49
+ {
50
+ get { return null ; }
51
+ set { }
52
+ }
37
53
}
38
54
39
55
class SinkAttribute : System . Attribute { }
40
- }
56
+
57
+ class SinkPropertyAttribute : System . Attribute { }
58
+
59
+ class SinkIndexerAttribute : System . Attribute { }
60
+ }
Original file line number Diff line number Diff line change @@ -18,14 +18,17 @@ void Foo()
18
18
x = TaggedSrcField ;
19
19
20
20
x = SrcTwoArg ( "" , "" ) ;
21
+
22
+ x = TaggedSrcPropertyGetter ;
23
+ x = this [ 0 ] ;
21
24
}
22
25
23
- [ SourceAttribute ( ) ]
26
+ [ SourceAttribute ]
24
27
void Tagged1 ( object taggedMethodParam )
25
28
{
26
29
}
27
30
28
- void Tagged2 ( [ SourceAttribute ( ) ] object taggedSrcParam )
31
+ void Tagged2 ( [ SourceAttribute ] object taggedSrcParam )
29
32
{
30
33
}
31
34
@@ -49,14 +52,20 @@ public override void SrcParam(object p) { }
49
52
50
53
void SrcArg ( object src ) { }
51
54
52
- [ SourceAttribute ( ) ]
55
+ [ SourceAttribute ]
53
56
object TaggedSrcMethod ( ) { return null ; }
54
57
55
- [ SourceAttribute ( ) ]
58
+ [ SourceAttribute ]
56
59
object TaggedSrcField ;
57
60
58
61
object SrcTwoArg ( string s1 , string s2 ) { return null ; }
62
+
63
+ [ SourceAttribute ]
64
+ object TaggedSrcPropertyGetter { get ; }
65
+
66
+ [ SourceAttribute ]
67
+ object this [ int i ] => null ;
59
68
}
60
69
61
70
class SourceAttribute : System . Attribute { }
62
- }
71
+ }
You can’t perform that action at this time.
0 commit comments