Skip to content

Commit 8d8e7c7

Browse files
committed
Swift: Adapt to changes in FlowSummaryImpl
1 parent 89c0a5a commit 8d8e7c7

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

swift/ql/lib/codeql/swift/dataflow/ExternalFlow.qll

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -499,40 +499,22 @@ private predicate interpretSummary(
499499

500500
// adapter class for converting Mad summaries to `SummarizedCallable`s
501501
private class SummarizedCallableAdapter extends SummarizedCallable {
502-
SummarizedCallableAdapter() { interpretSummary(this, _, _, _, _, _) }
502+
string input_;
503+
string output_;
504+
string kind;
505+
Provenance p_;
506+
string model_;
503507

504-
private predicate relevantSummaryElementManual(
505-
string input, string output, string kind, string model
506-
) {
507-
exists(Provenance provenance |
508-
interpretSummary(this, input, output, kind, provenance, model) and
509-
provenance.isManual()
510-
)
511-
}
512-
513-
private predicate relevantSummaryElementGenerated(
514-
string input, string output, string kind, string model
515-
) {
516-
exists(Provenance provenance |
517-
interpretSummary(this, input, output, kind, provenance, model) and
518-
provenance.isGenerated()
519-
)
520-
}
508+
SummarizedCallableAdapter() { interpretSummary(this, input_, output_, kind, p_, model_) }
521509

522510
override predicate propagatesFlow(
523-
string input, string output, boolean preservesValue, string model
511+
string input, string output, boolean preservesValue, Provenance p, boolean isExact, string model
524512
) {
525-
exists(string kind |
526-
this.relevantSummaryElementManual(input, output, kind, model)
527-
or
528-
not this.relevantSummaryElementManual(_, _, _, _) and
529-
this.relevantSummaryElementGenerated(input, output, kind, model)
530-
|
531-
if kind = "value" then preservesValue = true else preservesValue = false
532-
)
533-
}
534-
535-
override predicate hasProvenance(Provenance provenance) {
536-
interpretSummary(this, _, _, _, provenance, _)
513+
input = input_ and
514+
output = output_ and
515+
(if kind = "value" then preservesValue = true else preservesValue = false) and
516+
p = p_ and
517+
isExact = true and
518+
model = model_
537519
}
538520
}

0 commit comments

Comments
 (0)