Swift: Add a couple of dataflow test cases for operators that behave as an identity function.

This commit is contained in:
Geoffrey White
2023-02-20 15:28:45 +00:00
parent 1fb27354b9
commit 31967cc032
2 changed files with 7 additions and 0 deletions

View File

@@ -324,6 +324,7 @@ nodes
| test.swift:472:20:472:20 | cx [x] : | semmle.label | cx [x] : |
| test.swift:472:20:472:23 | .x : | semmle.label | .x : |
| test.swift:473:15:473:15 | z1 | semmle.label | z1 |
| test.swift:480:14:480:21 | call to source() | semmle.label | call to source() |
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 ... : |
@@ -408,3 +409,4 @@ subpaths
| test.swift:361:15:361:18 | .1 | test.swift:351:31:351:38 | call to source() : | test.swift:361:15:361:18 | .1 | result |
| test.swift:442:19:442:19 | a | test.swift:259:12:259:19 | call to source() : | test.swift:442:19:442:19 | a | result |
| test.swift:473:15:473:15 | z1 | test.swift:259:12:259:19 | call to source() : | test.swift:473:15:473:15 | z1 | result |
| test.swift:480:14:480:21 | call to source() | test.swift:480:14:480:21 | call to source() | test.swift:480:14:480:21 | call to source() | result |

View File

@@ -474,3 +474,8 @@ func testOptionalPropertyAccess(y: Int?) {
guard let z2 = cy.x else { return }
sink(arg: z2)
}
func testIdentityArithmetic() {
sink(arg: +source()) // $ MISSING: flow=479
sink(arg: (source())) // $ flow=480
}