Swift: Add syntax for selecting PostUpdateNodes in CSV rows.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-04-26 13:42:07 +01:00
parent bfbd45a220
commit e6c8428875
2 changed files with 15 additions and 12 deletions

View File

@@ -200,14 +200,19 @@ predicate interpretOutputSpecific(string c, InterpretNode mid, InterpretNode nod
}
predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode node) {
// Allow fields to be picked as input nodes.
exists(Node n, AstNode ast, MemberRefExpr e |
n = node.asNode() and
ast = mid.asElement()
|
c = "" and
e.getBase() = n.asExpr() and
ast = mid.asElement() and
e.getMember() = ast
|
// Allow fields to be picked as input nodes.
c = "" and
e.getBase() = n.asExpr()
or
// Allow post update nodes to be picked as input nodes when the `input` column
// of the row is `PostUpdate`.
c = "PostUpdate" and
e.getBase() = n.(PostUpdateNode).getPreUpdateNode().asExpr()
)
}

View File

@@ -50,10 +50,10 @@ private class TlsExtensionsSinks extends SinkModelCsv {
row =
[
// TLS-related properties of `URLSessionConfiguration`
";URLSessionConfiguration;false;tlsMinimumSupportedProtocolVersion;;;;tls-protocol-version",
";URLSessionConfiguration;false;tlsMinimumSupportedProtocol;;;;tls-protocol-version",
";URLSessionConfiguration;false;tlsMaximumSupportedProtocolVersion;;;;tls-protocol-version",
";URLSessionConfiguration;false;tlsMaximumSupportedProtocol;;;;tls-protocol-version",
";URLSessionConfiguration;false;tlsMinimumSupportedProtocolVersion;;;PostUpdate;tls-protocol-version",
";URLSessionConfiguration;false;tlsMinimumSupportedProtocol;;;PostUpdate;tls-protocol-version",
";URLSessionConfiguration;false;tlsMaximumSupportedProtocolVersion;;;PostUpdate;tls-protocol-version",
";URLSessionConfiguration;false;tlsMaximumSupportedProtocol;;;PostUpdate;tls-protocol-version",
]
}
}
@@ -62,7 +62,5 @@ private class TlsExtensionsSinks extends SinkModelCsv {
* A sink defined in a CSV model.
*/
private class DefaultTlsExtensionsSink extends InsecureTlsExtensionsSink {
DefaultTlsExtensionsSink() {
sinkNode(this.(DataFlow::PostUpdateNode).getPreUpdateNode(), "tls-protocol-version")
}
DefaultTlsExtensionsSink() { sinkNode(this, "tls-protocol-version") }
}