@@ -14,13 +14,13 @@ func main() {
1414 test1 ()
1515 test2 ()
1616 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)"
1919 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)"
2121 }
2222 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)"
2424 }
2525}
2626
@@ -33,29 +33,29 @@ func test1() {
3333}
3434
3535func 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 )
4141}
4242
43- func taintScalar (x * any , n int ) {
44- * x = source (n )
43+ func taintScalar (x * any ) {
44+ * x = source (10 )
4545}
4646
47- func taintArray (x [1 ]any , n int ) {
48- x [0 ] = source (n )
47+ func taintArray (x [1 ]any ) {
48+ x [0 ] = source (11 )
4949}
5050
51- func taintSlice (x []any , n int ) {
52- x [0 ] = source (n )
51+ func taintSlice (x []any ) {
52+ x [0 ] = source (12 )
5353}
5454
55- func taintMapKey (x map [any ]any , n int ) {
56- x [source (n )] = ""
55+ func taintMapKey (x map [any ]any ) {
56+ x [source (13 )] = ""
5757}
5858
59- func taintMapValue (x map [any ]any , n int ) {
60- x ["" ] = source (n )
59+ func taintMapValue (x map [any ]any ) {
60+ x ["" ] = source (14 )
6161}
0 commit comments