Skip to content

Commit e0fae76

Browse files
committed
Swift: move IteratorProtocol model to its own file
1 parent 7ca6b6f commit e0fae76

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Provides models for the `IteratorProtocol` Swift protocol.
3+
*/
4+
5+
private import codeql.swift.dataflow.ExternalFlow
6+
7+
/**
8+
* A model for `IteratorProtocol` members that permit taint flow.
9+
*/
10+
private class IteratorProtocolSummaries extends SummaryModelCsv {
11+
override predicate row(string row) {
12+
row =
13+
[
14+
";IteratorProtocol;true;next();;;Argument[-1].CollectionElement;ReturnValue.OptionalSome;value"
15+
]
16+
}
17+
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ private class SequenceSummaries extends SummaryModelCsv {
2929
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;value",
3030
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;value",
3131
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[0].ReturnValue;ReturnValue.OptionalSome;value",
32-
";Sequence;true;makeIterator();;;Argument[-1].CollectionElement;ReturnValue.CollectionElement;value",
33-
";IteratorProtocol;true;next();;;Argument[-1].CollectionElement;ReturnValue.OptionalSome;value"
32+
";Sequence;true;makeIterator();;;Argument[-1].CollectionElement;ReturnValue.CollectionElement;value"
3433
]
3534
}
3635
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ private import Data
99
private import FileManager
1010
private import FilePath
1111
private import InputStream
12+
private import IteratorProtocol
1213
private import ManualMemoryManagement
1314
private import NsData
1415
private import NsObject

0 commit comments

Comments
 (0)