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()
1212
1313 object fieldWrite = new object ( ) ;
1414 TaggedField = fieldWrite ;
15+
16+ object propertyWrite = new object ( ) ;
17+ TaggedPropertySetter = propertyWrite ;
18+
19+ object indexerWrite = new object ( ) ;
20+ this [ 0 ] = indexerWrite ;
1521 }
1622
1723 object SinkMethod ( )
@@ -34,7 +40,21 @@ void TaggedSinkMethod(object x) { }
3440
3541 [ SinkAttribute ]
3642 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+ }
3753 }
3854
3955 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()
1818 x = TaggedSrcField ;
1919
2020 x = SrcTwoArg ( "" , "" ) ;
21+
22+ x = TaggedSrcPropertyGetter ;
23+ x = this [ 0 ] ;
2124 }
2225
23- [ SourceAttribute ( ) ]
26+ [ SourceAttribute ]
2427 void Tagged1 ( object taggedMethodParam )
2528 {
2629 }
2730
28- void Tagged2 ( [ SourceAttribute ( ) ] object taggedSrcParam )
31+ void Tagged2 ( [ SourceAttribute ] object taggedSrcParam )
2932 {
3033 }
3134
@@ -49,14 +52,20 @@ public override void SrcParam(object p) { }
4952
5053 void SrcArg ( object src ) { }
5154
52- [ SourceAttribute ( ) ]
55+ [ SourceAttribute ]
5356 object TaggedSrcMethod ( ) { return null ; }
5457
55- [ SourceAttribute ( ) ]
58+ [ SourceAttribute ]
5659 object TaggedSrcField ;
5760
5861 object SrcTwoArg ( string s1 , string s2 ) { return null ; }
62+
63+ [ SourceAttribute ]
64+ object TaggedSrcPropertyGetter { get ; }
65+
66+ [ SourceAttribute ]
67+ object this [ int i ] => null ;
5968 }
6069
6170 class SourceAttribute : System . Attribute { }
62- }
71+ }
You can’t perform that action at this time.
0 commit comments