Skip to content

Commit b301092

Browse files
committed
Swift: model updates for Set
1 parent de0ec3e commit b301092

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ private class CollectionSummaries extends SummaryModelCsv {
2626
";Collection;true;split(separator:maxSplits:omittingEmptySubsequences:);;;Argument[-1];ReturnValue;taint",
2727
";Collection;true;removeFirst();;;Argument[-1];ReturnValue;taint",
2828
";Collection;true;popFirst();;;Argument[-1];ReturnValue;taint",
29+
";Collection;true;randomElement();;;Argument[-1].SetElement;ReturnValue.OptionalSome;value",
2930
";RangeReplaceableCollection;true;append(_:);;;Argument[0];Argument[-1];taint",
3031
";RangeReplaceableCollection;true;append(contentsOf:);;;Argument[0];Argument[-1];taint",
3132
";RangeReplaceableCollection;true;remove(at:);;;Argument[-1];ReturnValue;taint",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ private class SetSummaries extends SummaryModelCsv {
99
[
1010
";Set;true;insert(_:);;;Argument[-1].SetElement;ReturnValue.TupleElement[1];value",
1111
";Set;true;insert(_:);;;Argument[0];Argument[-1].SetElement;value",
12-
";Set;true;randomElement();;;Argument[-1].SetElement;ReturnValue;value"
12+
";Set;true;insert(_:);;;Argument[0];ReturnValue.TupleElement[1];value",
13+
";Set;true;init(_:);;;Argument[0].ArrayElement;ReturnValue.SetElement;value"
1314
]
1415
}
1516
}

0 commit comments

Comments
 (0)