Swift: update models for array/collection content

This commit is contained in:
Robert Marsh
2023-09-12 19:16:21 +00:00
parent 3b7295b0fd
commit 4b970ff774
5 changed files with 14 additions and 24 deletions

View File

@@ -19,20 +19,20 @@ private class ArraySummaries extends SummaryModelCsv {
override predicate row(string row) {
row =
[
";Array;true;insert(_:at:);;;Argument[0];Argument[-1].ArrayElement;value",
";Array;true;insert(_:at:);;;Argument[0];Argument[-1].CollectionElement;value",
";Array;true;insert(_:at:);;;Argument[1];Argument[-1];taint",
";Array;true;withUnsafeBufferPointer(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeBufferPointer(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;value",
";Array;true;withUnsafeBufferPointer(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;value",
";Array;true;withUnsafeBufferPointer(_:);;;Argument[0].ReturnValue;ReturnValue;value",
";Array;true;withUnsafeMutableBufferPointer(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeMutableBufferPointer(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;value",
";Array;true;withUnsafeMutableBufferPointer(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;value",
";Array;true;withUnsafeMutableBufferPointer(_:);;;Argument[0].Parameter[0].CollectionElement;Argument[-1].CollectionElement;value",
";Array;true;withUnsafeMutableBufferPointer(_:);;;Argument[0].ReturnValue;ReturnValue;value",
";Array;true;withUnsafeBytes(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeBytes(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeBytes(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeBytes(_:);;;Argument[0].ReturnValue;ReturnValue;value",
";Array;true;withUnsafeMutableBytes(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeMutableBytes(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeMutableBytes(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;taint",
";Array;true;withUnsafeMutableBytes(_:);;;Argument[0].Parameter[0].CollectionElement;Argument[-1].CollectionElement;value",
";Array;true;withUnsafeMutableBytes(_:);;;Argument[0].ReturnValue;ReturnValue;value",
";ContiguousArray;true;withUnsafeBufferPointer(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",

View File

@@ -27,7 +27,6 @@ private class CollectionSummaries extends SummaryModelCsv {
";Collection;true;removeFirst();;;Argument[-1];ReturnValue;taint",
";Collection;true;popFirst();;;Argument[-1];ReturnValue;taint",
";Collection;true;randomElement();;;Argument[-1].CollectionElement;ReturnValue.OptionalSome;value",
";Collection;true;randomElement();;;Argument[-1].ArrayElement;ReturnValue.OptionalSome;value",
";RangeReplaceableCollection;true;append(_:);;;Argument[0];Argument[-1];taint",
";RangeReplaceableCollection;true;append(contentsOf:);;;Argument[0];Argument[-1];taint",
";RangeReplaceableCollection;true;remove(at:);;;Argument[-1];ReturnValue;taint",
@@ -38,7 +37,6 @@ private class CollectionSummaries extends SummaryModelCsv {
";BidirectionalCollection;true;last(where:);;;Argument[-1];ReturnValue;taint",
";BidirectionalCollection;true;popLast();;;Argument[-1];ReturnValue;taint",
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;value",
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;value",
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[0].Parameter[0].CollectionElement;Argument[-1].CollectionElement;value",
";MutableCollection;true;withContiguousMutableStorageIfAvailable(_:);;;Argument[0].ReturnValue;ReturnValue.OptionalSome;value",

View File

@@ -26,7 +26,6 @@ private class SequenceSummaries extends SummaryModelCsv {
";Sequence;true;joined(separator:);;;Argument[-1..0];ReturnValue;taint",
";Sequence;true;first(where:);;;Argument[-1];ReturnValue;taint",
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1];Argument[0].Parameter[0].CollectionElement;taint",
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1].ArrayElement;Argument[0].Parameter[0].CollectionElement;value",
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[-1].CollectionElement;Argument[0].Parameter[0].CollectionElement;value",
";Sequence;true;withContiguousStorageIfAvailable(_:);;;Argument[0].ReturnValue;ReturnValue.OptionalSome;value",
]

View File

@@ -14,7 +14,7 @@ private class SetSummaries extends SummaryModelCsv {
";Set;true;insert(_:);;;Argument[-1].CollectionElement;ReturnValue.TupleElement[1];value",
";Set;true;insert(_:);;;Argument[0];Argument[-1].CollectionElement;value",
";Set;true;insert(_:);;;Argument[0];ReturnValue.TupleElement[1];value",
";Set;true;init(_:);;;Argument[0].ArrayElement;ReturnValue.CollectionElement;value"
";Set;true;init(_:);;;Argument[0].CollectionElement;ReturnValue.CollectionElement;value"
]
}
}

View File

@@ -34,7 +34,6 @@ private class StringSummaries extends SummaryModelCsv {
row =
[
";StringProtocol;true;init(cString:);;;Argument[0];ReturnValue;taint",
";StringProtocol;true;init(cString:);;;Argument[0].ArrayElement;ReturnValue;taint",
";StringProtocol;true;init(cString:);;;Argument[0].CollectionElement;ReturnValue;taint",
";StringProtocol;true;init(decoding:as:);;;Argument[0];ReturnValue;taint",
";StringProtocol;true;init(decodingCString:as:);;;Argument[0].OptionalSome.CollectionElement;ReturnValue.OptionalSome.TupleElement[0];taint",
@@ -46,12 +45,12 @@ private class StringSummaries extends SummaryModelCsv {
";StringProtocol;true;cString(using:);;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;capitalized(with:);;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;completePath(into:caseSensitive:matchesInto:filterTypes:);;;Argument[-1];Argument[0].OptionalSome.CollectionElement;taint",
";StringProtocol;true;completePath(into:caseSensitive:matchesInto:filterTypes:);;;Argument[-1];Argument[2].OptionalSome.CollectionElement.ArrayElement;taint",
";StringProtocol;true;completePath(into:caseSensitive:matchesInto:filterTypes:);;;Argument[-1];Argument[2].OptionalSome.CollectionElement.CollectionElement;taint",
";StringProtocol;true;components(separatedBy:);;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;data(using:allowLossyConversion:);;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;folding(options:locale:);;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;getBytes(_:maxLength:usedLength:encoding:options:range:remaining:);;;Argument[-1];Argument[0].ArrayElement;taint",
";StringProtocol;true;getCString(_:maxLength:encoding:);;;Argument[-1];Argument[0].ArrayElement;taint",
";StringProtocol;true;getBytes(_:maxLength:usedLength:encoding:options:range:remaining:);;;Argument[-1];Argument[0].CollectionElement;taint",
";StringProtocol;true;getCString(_:maxLength:encoding:);;;Argument[-1];Argument[0].CollectionElement;taint",
";StringProtocol;true;lowercased();;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;lowercased(with:);;;Argument[-1];ReturnValue;taint",
";StringProtocol;true;padding(toLength:withPad:startingAt:);;;Argument[-1];ReturnValue;taint",
@@ -74,20 +73,18 @@ private class StringSummaries extends SummaryModelCsv {
";String;true;init(repeating:count:);;;Argument[0];ReturnValue;taint",
";String;true;init(data:encoding:);;;Argument[0];ReturnValue.OptionalSome;taint",
";String;true;init(validatingUTF8:);;;Argument[0];ReturnValue.OptionalSome;taint",
";String;true;init(validatingUTF8:);;;Argument[0].ArrayElement;ReturnValue.OptionalSome;taint",
";String;true;init(validatingUTF8:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint",
";String;true;init(utf16CodeUnits:count:);;;Argument[0].CollectionElement;ReturnValue;taint",
";String;true;init(utf16CodeUnitsNoCopy:count:freeWhenDone:);;;Argument[0].CollectionElement;ReturnValue;taint",
";String;true;init(format:_:);;;Argument[0];ReturnValue;taint",
";String;true;init(format:_:);;;Argument[1].ArrayElement;ReturnValue;taint",
";String;true;init(format:_:);;;Argument[1].CollectionElement;ReturnValue;taint",
";String;true;init(format:arguments:);;;Argument[0];ReturnValue;taint",
";String;true;init(format:arguments:);;;Argument[1].ArrayElement;ReturnValue;taint",
";String;true;init(format:arguments:);;;Argument[1].CollectionElement;ReturnValue;taint",
";String;true;init(format:locale:_:);;;Argument[0];ReturnValue;taint",
";String;true;init(format:locale:_:);;;Argument[2].ArrayElement;ReturnValue;taint",
";String;true;init(format:locale:_:);;;Argument[2].CollectionElement;ReturnValue;taint",
";String;true;init(format:locale:arguments:);;;Argument[0];ReturnValue;taint",
";String;true;init(format:locale:arguments:);;;Argument[2].ArrayElement;ReturnValue;taint",
";String;true;init(format:locale:arguments:);;;Argument[2].CollectionElement;ReturnValue;taint",
";String;true;init(_:radix:uppercase:);;;Argument[0];ReturnValue;taint",
";String;true;init(bytes:encoding:);;;Argument[0].ArrayElement;ReturnValue.OptionalSome;taint",
";String;true;init(bytes:encoding:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint",
";String;true;init(bytesNoCopy:length:encoding:freeWhenDone:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint",
";String;true;init(describing:);;;Argument[0];ReturnValue;taint",
@@ -104,20 +101,16 @@ private class StringSummaries extends SummaryModelCsv {
";String;true;init(unicodeScalarLiteral:);;;Argument[0];ReturnValue;taint",
";String;true;init(extendedGraphemeClusterLiteral:);;;Argument[0];ReturnValue;taint",
";String;true;init(cString:encoding:);;;Argument[0];ReturnValue.OptionalSome;taint",
";String;true;init(cString:encoding:);;;Argument[0].ArrayElement;ReturnValue.OptionalSome;taint",
";String;true;init(cString:encoding:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint",
";String;true;init(platformString:);;;Argument[0];ReturnValue;taint",
";String;true;init(platformString:);;;Argument[0].ArrayElement;ReturnValue;taint",
";String;true;init(platformString:);;;Argument[0].CollectionElement;ReturnValue;taint",
";String;true;init(utf8String:);;;Argument[0];ReturnValue.OptionalSome;taint",
";String;true;init(utf8String:);;;Argument[0].ArrayElement;ReturnValue.OptionalSome;taint",
";String;true;init(utf8String:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint",
";String;true;init(validating:);;;Argument[0];ReturnValue.OptionalSome;taint",
";String;true;init(validatingPlatformString:);;;Argument[0];ReturnValue.OptionalSome;taint",
";String;true;init(validatingPlatformString:);;;Argument[0].ArrayElement;ReturnValue.OptionalSome;taint",
";String;true;init(validatingPlatformString:);;;Argument[0].CollectionElement;ReturnValue.OptionalSome;taint",
";String;true;localizedStringWithFormat(_:_:);;;Argument[0];ReturnValue;taint",
";String;true;localizedStringWithFormat(_:_:);;;Argument[1].ArrayContent;ReturnValue;taint",
";String;true;localizedStringWithFormat(_:_:);;;Argument[1].CollectionElement;ReturnValue;taint",
";String;true;write(_:);;;Argument[0];Argument[-1];taint",
";String;true;write(to:);;;Argument[-1];Argument[0];taint",
";String;true;insert(contentsOf:at:);;;Argument[0];Argument[-1];taint",