Skip to content

Commit 6f0f739

Browse files
committed
Swift: Update dropFirst / dropLast / reversed models for Swift 6.
1 parent 1f35607 commit 6f0f739

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

swift/ql/lib/codeql/swift/frameworks/StandardLibrary/Collection.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ private class CollectionSummaries extends SummaryModelCsv {
2121
";Collection;true;suffix(_:);;;Argument[-1];ReturnValue;taint",
2222
";Collection;true;suffix(from:);;;Argument[-1];ReturnValue;taint",
2323
";Collection;true;dropFirst(_:);;;Argument[-1];ReturnValue;taint",
24+
";Collection;true;dropFirst(_:);;;Argument[-1].CollectionElement;ReturnValue.CollectionElement;value",
2425
";Collection;true;dropLast(_:);;;Argument[-1];ReturnValue;taint",
26+
";Collection;true;dropLast(_:);;;Argument[-1].CollectionElement;ReturnValue.CollectionElement;value",
2527
";Collection;true;split(maxSplits:omittingEmptySubsequences:whereSeparator:);;;Argument[-1];ReturnValue;taint",
2628
";Collection;true;split(separator:maxSplits:omittingEmptySubsequences:);;;Argument[-1];ReturnValue;taint",
2729
";Collection;true;removeFirst();;;Argument[-1];ReturnValue;taint",
@@ -38,9 +40,13 @@ private class CollectionSummaries extends SummaryModelCsv {
3840
";RangeReplaceableCollection;true;insert(_:at:);;;Argument[0];Argument[-1];taint",
3941
";RangeReplaceableCollection;true;replaceSubrange(_:with:);;;Argument[1];Argument[-1];taint",
4042
";RangeReplaceableCollection;true;replaceSubrange(_:with:);;;Argument[1].CollectionElement;Argument[-1].CollectionElement;value",
43+
";BidirectionalCollection;true;dropLast(_:);;;Argument[-1];ReturnValue;taint",
44+
";BidirectionalCollection;true;dropLast(_:);;;Argument[-1].CollectionElement;ReturnValue.CollectionElement;value",
4145
";BidirectionalCollection;true;joined(separator:);;;Argument[-1..0];ReturnValue;taint",
4246
";BidirectionalCollection;true;last(where:);;;Argument[-1];ReturnValue;taint",
4347
";BidirectionalCollection;true;popLast();;;Argument[-1];ReturnValue;taint",
48+
";BidirectionalCollection;true;reversed();;;Argument[-1];ReturnValue;taint",
49+
";BidirectionalCollection;true;reversed();;;Argument[-1].CollectionElement;ReturnValue.CollectionElement;value",
4450
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
4551
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;value",
4652
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[0].Parameter[0].CollectionElement;Argument[-1].CollectionElement;value",

swift/ql/test/library-tests/dataflow/taint/libraries/TaintInline.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
testFailures
22
| optionset.swift:60:49:61:1 | // $ tainted=60\n | Missing result: tainted=60 |
33
| optionset.swift:65:58:66:1 | // $ tainted=65\n | Missing result: tainted=65 |
4-
| string.swift:237:35:238:1 | // $ tainted=217\n | Missing result: tainted=217 |
5-
| string.swift:244:33:245:1 | // $ tainted=217\n | Missing result: tainted=217 |
64
| string.swift:270:40:271:1 | // $ tainted=217\n | Missing result: tainted=217 |
75
| string.swift:271:40:272:1 | // $ tainted=217\n | Missing result: tainted=217 |
86
| string.swift:272:42:273:1 | // $ tainted=217\n | Missing result: tainted=217 |

0 commit comments

Comments
 (0)