Java/C#: Address review comments.

This commit is contained in:
Michael Nebel
2024-09-05 19:22:31 +02:00
parent 7bf7df2f99
commit e1048cf8ea
2 changed files with 24 additions and 24 deletions

View File

@@ -279,24 +279,24 @@ private module PropagateContentFlowConfig implements ContentDataFlow::ConfigSig
private module PropagateContentFlow = ContentDataFlow::Global<PropagateContentFlowConfig>; private module PropagateContentFlow = ContentDataFlow::Global<PropagateContentFlowConfig>;
private string printStoreAccessPath(PropagateContentFlow::AccessPath ap) { private string getContent(PropagateContentFlow::AccessPath ap, int i) {
not exists(ap.getHead()) and result = ""
or
exists(ContentSet head, PropagateContentFlow::AccessPath tail | exists(ContentSet head, PropagateContentFlow::AccessPath tail |
head = ap.getHead() and head = ap.getHead() and
tail = ap.getTail() and tail = ap.getTail()
result = "." + printContent(head) + printStoreAccessPath(tail) |
i = 0 and
result = "." + printContent(head)
or
i > 0 and result = getContent(tail, i - 1)
) )
} }
private string printStoreAccessPath(PropagateContentFlow::AccessPath ap) {
result = concat(int i | | getContent(ap, i), "" order by i)
}
private string printReadAccessPath(PropagateContentFlow::AccessPath ap) { private string printReadAccessPath(PropagateContentFlow::AccessPath ap) {
not exists(ap.getHead()) and result = "" result = concat(int i | | getContent(ap, i), "" order by i desc)
or
exists(ContentSet head, PropagateContentFlow::AccessPath tail |
head = ap.getHead() and
tail = ap.getTail() and
result = printReadAccessPath(tail) + "." + printContent(head)
)
} }
string captureContentFlow(DataFlowSummaryTargetApi api) { string captureContentFlow(DataFlowSummaryTargetApi api) {

View File

@@ -279,24 +279,24 @@ private module PropagateContentFlowConfig implements ContentDataFlow::ConfigSig
private module PropagateContentFlow = ContentDataFlow::Global<PropagateContentFlowConfig>; private module PropagateContentFlow = ContentDataFlow::Global<PropagateContentFlowConfig>;
private string printStoreAccessPath(PropagateContentFlow::AccessPath ap) { private string getContent(PropagateContentFlow::AccessPath ap, int i) {
not exists(ap.getHead()) and result = ""
or
exists(ContentSet head, PropagateContentFlow::AccessPath tail | exists(ContentSet head, PropagateContentFlow::AccessPath tail |
head = ap.getHead() and head = ap.getHead() and
tail = ap.getTail() and tail = ap.getTail()
result = "." + printContent(head) + printStoreAccessPath(tail) |
i = 0 and
result = "." + printContent(head)
or
i > 0 and result = getContent(tail, i - 1)
) )
} }
private string printStoreAccessPath(PropagateContentFlow::AccessPath ap) {
result = concat(int i | | getContent(ap, i), "" order by i)
}
private string printReadAccessPath(PropagateContentFlow::AccessPath ap) { private string printReadAccessPath(PropagateContentFlow::AccessPath ap) {
not exists(ap.getHead()) and result = "" result = concat(int i | | getContent(ap, i), "" order by i desc)
or
exists(ContentSet head, PropagateContentFlow::AccessPath tail |
head = ap.getHead() and
tail = ap.getTail() and
result = printReadAccessPath(tail) + "." + printContent(head)
)
} }
string captureContentFlow(DataFlowSummaryTargetApi api) { string captureContentFlow(DataFlowSummaryTargetApi api) {