Skip to content

Commit eeed2c2

Browse files
authored
Merge pull request github#18154 from geoffw0/swift6models4
Swift: Fix for OptionSet and BinaryInteger models
2 parents 14b70b8 + e9deec7 commit eeed2c2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ private import codeql.swift.dataflow.FlowSteps
1212
*/
1313
private class RawRepresentableSummaries extends SummaryModelCsv {
1414
override predicate row(string row) {
15-
row = ";RawRepresentable;true;init(rawValue:);;;Argument[0];ReturnValue;taint"
15+
row =
16+
[
17+
";RawRepresentable;true;init(rawValue:);;;Argument[0];ReturnValue;taint",
18+
";OptionSet;true;init(rawValue:);;;Argument[0];ReturnValue;taint"
19+
]
1620
}
1721
}
1822

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private class StringFieldsInheritTaint extends TaintInheritingContent,
167167
"precomposedStringWithCompatibilityMapping", "removingPercentEncoding"
168168
]
169169
or
170-
namedTypeDecl.getFullName() = "CustomStringConvertible" and
170+
namedTypeDecl.getFullName() = ["CustomStringConvertible", "BinaryInteger"] and
171171
fieldDecl.getName() = "description"
172172
or
173173
namedTypeDecl.getFullName() = "CustomDebugStringConvertible" and
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
testFailures
2-
| optionset.swift:60:49:61:1 | // $ tainted=60\n | Missing result: tainted=60 |
3-
| optionset.swift:65:58:66:1 | // $ tainted=65\n | Missing result: tainted=65 |
4-
| string.swift:599:35:600:1 | // $ tainted=599\n | Missing result: tainted=599 |
52
failures

0 commit comments

Comments
 (0)