@@ -14,13 +14,13 @@ func main() {
14
14
test1 ()
15
15
test2 ()
16
16
sink (globalScalar ) // $ hasValueFlow="globalScalar (from source 0)" MISSING: hasValueFlow="globalScalar (from source 10)"
17
- sink (globalArray [0 ]) // $ MISSING: hasValueFlow="index expression (from source 1)" hasValueFlow="index expression (from source 11)"
18
- sink (globalSlice [0 ]) // $ MISSING: hasValueFlow="index expression (from source 2)" hasValueFlow="index expression (from source 12)"
17
+ sink (globalArray [0 ]) // $ hasValueFlow="index expression (from source 1)" hasValueFlow="index expression (from source 11)"
18
+ sink (globalSlice [0 ]) // $ hasValueFlow="index expression (from source 2)" hasValueFlow="index expression (from source 12)"
19
19
for val := range globalMap1 {
20
- sink (val ) // $ MISSING: hasValueFlow="val (from source 3)" hasValueFlow="val (from source 13)"
20
+ sink (val ) // $ hasValueFlow="val (from source 3)" hasValueFlow="val (from source 13)"
21
21
}
22
22
for _ , val := range globalMap2 {
23
- sink (val ) // $ MISSING: hasValueFlow="val (from source 4)" hasValueFlow="val (from source 14)"
23
+ sink (val ) // $ hasValueFlow="val (from source 4)" hasValueFlow="val (from source 14)"
24
24
}
25
25
}
26
26
@@ -33,29 +33,29 @@ func test1() {
33
33
}
34
34
35
35
func test2 () {
36
- taintScalar (& globalScalar , 10 )
37
- taintArray (globalArray , 11 )
38
- taintSlice (globalSlice , 12 )
39
- taintMapKey (globalMap1 , 13 )
40
- taintMapValue (globalMap2 , 14 )
36
+ taintScalar (& globalScalar )
37
+ taintArray (globalArray )
38
+ taintSlice (globalSlice )
39
+ taintMapKey (globalMap1 )
40
+ taintMapValue (globalMap2 )
41
41
}
42
42
43
- func taintScalar (x * any , n int ) {
44
- * x = source (n )
43
+ func taintScalar (x * any ) {
44
+ * x = source (10 )
45
45
}
46
46
47
- func taintArray (x [1 ]any , n int ) {
48
- x [0 ] = source (n )
47
+ func taintArray (x [1 ]any ) {
48
+ x [0 ] = source (11 )
49
49
}
50
50
51
- func taintSlice (x []any , n int ) {
52
- x [0 ] = source (n )
51
+ func taintSlice (x []any ) {
52
+ x [0 ] = source (12 )
53
53
}
54
54
55
- func taintMapKey (x map [any ]any , n int ) {
56
- x [source (n )] = ""
55
+ func taintMapKey (x map [any ]any ) {
56
+ x [source (13 )] = ""
57
57
}
58
58
59
- func taintMapValue (x map [any ]any , n int ) {
60
- x ["" ] = source (n )
59
+ func taintMapValue (x map [any ]any ) {
60
+ x ["" ] = source (14 )
61
61
}
0 commit comments