File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
csharp/ql/test/library-tests/dataflow/fields Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+
3
+ public class L
4
+ {
5
+ public string f1 { get ; set ; }
6
+ public string f2 { get ; set ; }
7
+ public string f3 { get ; set ; }
8
+
9
+ private void M1 ( )
10
+ {
11
+ // dynamic write followed by dynamic read
12
+ dynamic d1 = this ;
13
+ d1 . f1 = Source < string > ( 1 ) ;
14
+ Sink ( d1 . f1 ) ; // $ MISSING: hasValueFlow=1
15
+
16
+ // dynamic write followed by static read
17
+ dynamic d2 = this ;
18
+ d2 . f2 = Source < string > ( 2 ) ;
19
+ L l2 = d2 ;
20
+ Sink ( l2 . f2 ) ; // $ MISSING: hasValueFlow=2
21
+
22
+ // static write followed by dynamic read
23
+ this . f3 = Source < string > ( 3 ) ;
24
+ dynamic d3 = this ;
25
+ Sink ( d3 . f3 ) ; // $ MISSING: hasValueFlow=3
26
+ }
27
+
28
+ public static void Sink ( object o ) { }
29
+
30
+ static T Source < T > ( object source ) => throw null ;
31
+ }
You can’t perform that action at this time.
0 commit comments