Skip to content

Commit e087996

Browse files
committed
Update tests
1 parent aaa8f9c commit e087996

File tree

2 files changed

+10
-10
lines changed
  • go/ql/test/library-tests/semmle/go/dataflow

2 files changed

+10
-10
lines changed

go/ql/test/library-tests/semmle/go/dataflow/ArrayConversion/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ func main() {
1616
var a [4]string
1717
a[0] = source()
1818
alias := [2]string(a[:])
19-
sink(alias[0]) // $ hasTaintFlow="index expression"
20-
sink(alias[1]) // $ SPURIOUS: hasTaintFlow="index expression" // we don't distinguish different elements of arrays or slices
19+
sink(alias[0]) // $ hasValueFlow="index expression"
20+
sink(alias[1]) // $ SPURIOUS: hasValueFlow="index expression" // we don't distinguish different elements of arrays or slices
2121
sink(alias) // $ hasTaintFlow="alias"
2222

2323
// Compare with the standard dataflow support for arrays

go/ql/test/library-tests/semmle/go/dataflow/SliceExpressions/main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,31 @@ func main() {
1515
func arrayBase(base [4]string) {
1616
base[1] = source()
1717
slice := base[1:4]
18-
sink(slice[0]) // $ hasTaintFlow="index expression"
19-
sink(slice[1]) // $ SPURIOUS: hasTaintFlow="index expression" // we don't distinguish different elements of arrays or slices
18+
sink(slice[0]) // $ hasValueFlow="index expression"
19+
sink(slice[1]) // $ SPURIOUS: hasValueFlow="index expression" // we don't distinguish different elements of arrays or slices
2020
sink(slice) // $ hasTaintFlow="slice"
2121
}
2222

2323
func arrayPointerBase(base *[4]string) {
2424
base[1] = source()
2525
slice := base[1:4]
26-
sink(slice[0]) // $ hasTaintFlow="index expression"
27-
sink(slice[1]) // $ SPURIOUS: hasTaintFlow="index expression" // we don't distinguish different elements of arrays or slices
26+
sink(slice[0]) // $ hasValueFlow="index expression"
27+
sink(slice[1]) // $ SPURIOUS: hasValueFlow="index expression" // we don't distinguish different elements of arrays or slices
2828
sink(slice) // $ hasTaintFlow="slice"
2929
}
3030

3131
func sliceBase(base []string) {
3232
base[1] = source()
3333
slice := base[1:4]
34-
sink(slice[0]) // $ hasTaintFlow="index expression"
35-
sink(slice[1]) // $ SPURIOUS: hasTaintFlow="index expression" // we don't distinguish different elements of arrays or slices
34+
sink(slice[0]) // $ hasValueFlow="index expression"
35+
sink(slice[1]) // $ SPURIOUS: hasValueFlow="index expression" // we don't distinguish different elements of arrays or slices
3636
sink(slice) // $ hasTaintFlow="slice"
3737
}
3838

3939
func slicePointerBase(base *[]string) {
4040
(*base)[1] = source()
4141
slice := (*base)[1:4]
42-
sink(slice[0]) // $ hasTaintFlow="index expression"
43-
sink(slice[1]) // $ SPURIOUS: hasTaintFlow="index expression" // we don't distinguish different elements of arrays or slices
42+
sink(slice[0]) // $ hasValueFlow="index expression"
43+
sink(slice[1]) // $ SPURIOUS: hasValueFlow="index expression" // we don't distinguish different elements of arrays or slices
4444
sink(slice) // $ hasTaintFlow="slice"
4545
}

0 commit comments

Comments
 (0)