Swift: additional dataflow tests for arrays

This commit is contained in:
Robert Marsh
2023-07-17 18:00:48 +00:00
parent ef9376d39c
commit 0b35be284e
3 changed files with 56 additions and 14 deletions

View File

@@ -277,9 +277,15 @@ edges
| test.swift:638:5:638:5 | [post] &... [Array element] | test.swift:639:15:639:15 | &... [Array element] |
| test.swift:638:15:638:22 | call to source() | test.swift:638:5:638:5 | [post] &... [Array element] |
| test.swift:639:15:639:15 | &... [Array element] | test.swift:639:15:639:21 | ...[...] |
| test.swift:641:16:641:25 | [...] [Array element] | test.swift:642:15:642:15 | &... [Array element] |
| test.swift:641:17:641:24 | call to source() | test.swift:641:16:641:25 | [...] [Array element] |
| test.swift:642:15:642:15 | &... [Array element] | test.swift:642:15:642:21 | ...[...] |
| test.swift:642:16:642:25 | [...] [Array element] | test.swift:643:15:643:15 | &... [Array element] |
| test.swift:642:17:642:24 | call to source() | test.swift:642:16:642:25 | [...] [Array element] |
| test.swift:643:15:643:15 | &... [Array element] | test.swift:643:15:643:21 | ...[...] |
| test.swift:645:18:645:29 | [...] [Array element, Array element] | test.swift:647:15:647:15 | &... [Array element, Array element] |
| test.swift:645:19:645:28 | [...] [Array element] | test.swift:645:18:645:29 | [...] [Array element, Array element] |
| test.swift:645:20:645:27 | call to source() | test.swift:645:19:645:28 | [...] [Array element] |
| test.swift:647:15:647:15 | &... [Array element, Array element] | test.swift:647:15:647:23 | ...[...] [Array element] |
| test.swift:647:15:647:23 | &... [Array element] | test.swift:647:15:647:26 | ...[...] |
| test.swift:647:15:647:23 | ...[...] [Array element] | test.swift:647:15:647:23 | &... [Array element] |
nodes
| file://:0:0:0:0 | .a [x] | semmle.label | .a [x] |
| file://:0:0:0:0 | .str | semmle.label | .str |
@@ -584,10 +590,17 @@ nodes
| test.swift:638:15:638:22 | call to source() | semmle.label | call to source() |
| test.swift:639:15:639:15 | &... [Array element] | semmle.label | &... [Array element] |
| test.swift:639:15:639:21 | ...[...] | semmle.label | ...[...] |
| test.swift:641:16:641:25 | [...] [Array element] | semmle.label | [...] [Array element] |
| test.swift:641:17:641:24 | call to source() | semmle.label | call to source() |
| test.swift:642:15:642:15 | &... [Array element] | semmle.label | &... [Array element] |
| test.swift:642:15:642:21 | ...[...] | semmle.label | ...[...] |
| test.swift:642:16:642:25 | [...] [Array element] | semmle.label | [...] [Array element] |
| test.swift:642:17:642:24 | call to source() | semmle.label | call to source() |
| test.swift:643:15:643:15 | &... [Array element] | semmle.label | &... [Array element] |
| test.swift:643:15:643:21 | ...[...] | semmle.label | ...[...] |
| test.swift:645:18:645:29 | [...] [Array element, Array element] | semmle.label | [...] [Array element, Array element] |
| test.swift:645:19:645:28 | [...] [Array element] | semmle.label | [...] [Array element] |
| test.swift:645:20:645:27 | call to source() | semmle.label | call to source() |
| test.swift:647:15:647:15 | &... [Array element, Array element] | semmle.label | &... [Array element, Array element] |
| test.swift:647:15:647:23 | &... [Array element] | semmle.label | &... [Array element] |
| test.swift:647:15:647:23 | ...[...] [Array element] | semmle.label | ...[...] [Array element] |
| test.swift:647:15:647:26 | ...[...] | semmle.label | ...[...] |
subpaths
| test.swift:75:21:75:22 | &... | test.swift:65:16:65:28 | arg1 | test.swift:65:1:70:1 | arg2[return] | test.swift:75:31:75:32 | [post] &... |
| test.swift:114:19:114:19 | arg | test.swift:109:9:109:14 | arg | test.swift:110:12:110:12 | arg | test.swift:114:12:114:22 | call to ... |
@@ -703,4 +716,5 @@ subpaths
| test.swift:631:15:631:15 | x | test.swift:628:9:628:16 | call to source() | test.swift:631:15:631:15 | x | result |
| test.swift:632:15:632:15 | y | test.swift:628:9:628:16 | call to source() | test.swift:632:15:632:15 | y | result |
| test.swift:639:15:639:21 | ...[...] | test.swift:638:15:638:22 | call to source() | test.swift:639:15:639:21 | ...[...] | result |
| test.swift:642:15:642:21 | ...[...] | test.swift:641:17:641:24 | call to source() | test.swift:642:15:642:21 | ...[...] | result |
| test.swift:643:15:643:21 | ...[...] | test.swift:642:17:642:24 | call to source() | test.swift:643:15:643:21 | ...[...] | result |
| test.swift:647:15:647:26 | ...[...] | test.swift:645:20:645:27 | call to source() | test.swift:647:15:647:26 | ...[...] | result |

View File

@@ -694,8 +694,36 @@
| test.swift:638:5:638:5 | &... | test.swift:639:15:639:15 | arr1 |
| test.swift:638:5:638:5 | [post] &... | test.swift:639:15:639:15 | arr1 |
| test.swift:638:5:638:5 | arr1 | test.swift:638:5:638:5 | &... |
| test.swift:639:15:639:15 | &... | test.swift:640:15:640:15 | arr1 |
| test.swift:639:15:639:15 | [post] &... | test.swift:640:15:640:15 | arr1 |
| test.swift:639:15:639:15 | arr1 | test.swift:639:15:639:15 | &... |
| test.swift:641:9:641:9 | SSA def(arr2) | test.swift:642:15:642:15 | arr2 |
| test.swift:641:9:641:9 | arr2 | test.swift:641:9:641:9 | SSA def(arr2) |
| test.swift:641:16:641:25 | [...] | test.swift:641:9:641:9 | arr2 |
| test.swift:642:15:642:15 | arr2 | test.swift:642:15:642:15 | &... |
| test.swift:642:9:642:9 | SSA def(arr2) | test.swift:643:15:643:15 | arr2 |
| test.swift:642:9:642:9 | arr2 | test.swift:642:9:642:9 | SSA def(arr2) |
| test.swift:642:16:642:25 | [...] | test.swift:642:9:642:9 | arr2 |
| test.swift:643:15:643:15 | &... | test.swift:650:16:650:16 | arr2 |
| test.swift:643:15:643:15 | [post] &... | test.swift:650:16:650:16 | arr2 |
| test.swift:643:15:643:15 | arr2 | test.swift:643:15:643:15 | &... |
| test.swift:645:9:645:9 | SSA def(matrix) | test.swift:646:15:646:15 | matrix |
| test.swift:645:9:645:9 | matrix | test.swift:645:9:645:9 | SSA def(matrix) |
| test.swift:645:18:645:29 | [...] | test.swift:645:9:645:9 | matrix |
| test.swift:646:15:646:15 | &... | test.swift:647:15:647:15 | matrix |
| test.swift:646:15:646:15 | [post] &... | test.swift:647:15:647:15 | matrix |
| test.swift:646:15:646:15 | matrix | test.swift:646:15:646:15 | &... |
| test.swift:647:15:647:15 | matrix | test.swift:647:15:647:15 | &... |
| test.swift:647:15:647:23 | ...[...] | test.swift:647:15:647:23 | &... |
| test.swift:649:9:649:9 | SSA def(arr3) | test.swift:650:23:650:23 | arr3 |
| test.swift:649:9:649:9 | arr3 | test.swift:649:9:649:9 | SSA def(arr3) |
| test.swift:649:16:649:18 | [...] | test.swift:649:9:649:9 | arr3 |
| test.swift:650:9:650:9 | SSA def(arr4) | test.swift:652:15:652:15 | arr4 |
| test.swift:650:9:650:9 | arr4 | test.swift:650:9:650:9 | SSA def(arr4) |
| test.swift:650:16:650:23 | ... .+(_:_:) ... | test.swift:650:9:650:9 | arr4 |
| test.swift:650:23:650:23 | arr3 | test.swift:651:15:651:15 | arr3 |
| test.swift:654:9:654:9 | SSA def(arr5) | test.swift:655:15:655:15 | arr5 |
| test.swift:654:9:654:9 | arr5 | test.swift:654:9:654:9 | SSA def(arr5) |
| test.swift:654:16:654:51 | call to Array<Element>.init(repeating:count:) | test.swift:654:9:654:9 | arr5 |
| test.swift:657:9:657:9 | SSA def(arr6) | test.swift:658:5:658:5 | arr6 |
| test.swift:657:9:657:9 | arr6 | test.swift:657:9:657:9 | SSA def(arr6) |
| test.swift:657:16:657:22 | [...] | test.swift:657:9:657:9 | arr6 |
| test.swift:658:5:658:5 | &... | test.swift:659:15:659:15 | arr6 |
| test.swift:658:5:658:5 | [post] &... | test.swift:659:15:659:15 | arr6 |
| test.swift:658:5:658:5 | arr6 | test.swift:658:5:658:5 | &... |

View File

@@ -649,10 +649,10 @@ func testArray() {
var arr3 = [1]
var arr4 = arr2 + arr3
sink(arg: arr3)
sink(arg: arr4) // $ flow=642
sink(arg: arr4) // $ MISSING: flow=642
var arr5 = Array(repeating: source(), count: 2)
sink(arg: arr5) // $ flow=654
sink(arg: arr5) // $ MISSING: flow=654
var arr6 = [1,2,3]
arr6.insert(source(), at: 2)