Skip to content

Commit

Permalink
Merge pull request #18154 from geoffw0/swift6models4
Browse files Browse the repository at this point in the history
Swift: Fix for OptionSet and BinaryInteger models
  • Loading branch information
geoffw0 authored Nov 29, 2024
2 parents 14b70b8 + e9deec7 commit eeed2c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ private import codeql.swift.dataflow.FlowSteps
*/
private class RawRepresentableSummaries extends SummaryModelCsv {
override predicate row(string row) {
row = ";RawRepresentable;true;init(rawValue:);;;Argument[0];ReturnValue;taint"
row =
[
";RawRepresentable;true;init(rawValue:);;;Argument[0];ReturnValue;taint",
";OptionSet;true;init(rawValue:);;;Argument[0];ReturnValue;taint"
]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private class StringFieldsInheritTaint extends TaintInheritingContent,
"precomposedStringWithCompatibilityMapping", "removingPercentEncoding"
]
or
namedTypeDecl.getFullName() = "CustomStringConvertible" and
namedTypeDecl.getFullName() = ["CustomStringConvertible", "BinaryInteger"] and
fieldDecl.getName() = "description"
or
namedTypeDecl.getFullName() = "CustomDebugStringConvertible" and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
testFailures
| optionset.swift:60:49:61:1 | // $ tainted=60\n | Missing result: tainted=60 |
| optionset.swift:65:58:66:1 | // $ tainted=65\n | Missing result: tainted=65 |
| string.swift:599:35:600:1 | // $ tainted=599\n | Missing result: tainted=599 |
failures

0 comments on commit eeed2c2

Please sign in to comment.