Skip to content

Commit c49d525

Browse files
committed
Revise ExternalFlow and FlowSummaryImpl API used for test generation
1 parent b1af909 commit c49d525

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -415,19 +415,25 @@ predicate summaryModel(
415415
string namespace, string type, boolean subtypes, string name, string signature, string ext,
416416
string input, string output, string kind
417417
) {
418-
exists(string row |
419-
summaryModel(row) and
420-
row.splitAt(";", 0) = namespace and
421-
row.splitAt(";", 1) = type and
422-
row.splitAt(";", 2) = subtypes.toString() and
423-
subtypes = [true, false] and
424-
row.splitAt(";", 3) = name and
425-
row.splitAt(";", 4) = signature and
426-
row.splitAt(";", 5) = ext and
427-
row.splitAt(";", 6) = input and
428-
row.splitAt(";", 7) = output and
429-
row.splitAt(";", 8) = kind
430-
)
418+
summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, _)
419+
}
420+
421+
/** Holds if a summary model `row` exists for the given parameters. */
422+
predicate summaryModel(
423+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
424+
string input, string output, string kind, string row
425+
) {
426+
summaryModel(row) and
427+
row.splitAt(";", 0) = namespace and
428+
row.splitAt(";", 1) = type and
429+
row.splitAt(";", 2) = subtypes.toString() and
430+
subtypes = [true, false] and
431+
row.splitAt(";", 3) = name and
432+
row.splitAt(";", 4) = signature and
433+
row.splitAt(";", 5) = ext and
434+
row.splitAt(";", 6) = input and
435+
row.splitAt(";", 7) = output and
436+
row.splitAt(";", 8) = kind
431437
}
432438

433439
private predicate relevantPackage(string package) {

java/ql/src/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,14 @@ module Private {
643643
)
644644
}
645645

646-
private predicate interpretSpec(string spec, int idx, SummaryComponentStack stack) {
646+
/**
647+
* Holds if `spec` specifies summary component stack `stack`.
648+
*/
649+
predicate interpretSpec(string spec, SummaryComponentStack stack) {
650+
interpretSpec(spec, 0, stack)
651+
}
652+
653+
predicate interpretSpec(string spec, int idx, SummaryComponentStack stack) {
647654
exists(string c |
648655
relevantSpec(spec) and
649656
specLength(spec, idx + 1) and

0 commit comments

Comments
 (0)