Skip to content

Commit 37644d3

Browse files
authored
Merge pull request #7281 from michaelnebel/csharp-flowsummaries-filtered
C#: Filtered flow summaries
2 parents 55c17f4 + ad281c0 commit 37644d3

File tree

6 files changed

+2862
-9
lines changed

6 files changed

+2862
-9
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,13 @@ module Private {
10041004
abstract class RelevantSummarizedCallable extends SummarizedCallable {
10051005
/** Gets the string representation of this callable used by `summary/1`. */
10061006
abstract string getCallableCsv();
1007+
1008+
/** Holds if flow is progated between `input` and `output` */
1009+
predicate relevantSummary(
1010+
SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue
1011+
) {
1012+
this.propagatesFlow(input, output, preservesValue)
1013+
}
10071014
}
10081015

10091016
/** Render the kind in the format used in flow summaries. */
@@ -1023,7 +1030,7 @@ module Private {
10231030
RelevantSummarizedCallable c, SummaryComponentStack input, SummaryComponentStack output,
10241031
boolean preservesValue
10251032
|
1026-
c.propagatesFlow(input, output, preservesValue) and
1033+
c.relevantSummary(input, output, preservesValue) and
10271034
csv =
10281035
c.getCallableCsv() + ";;" + getComponentStackCsv(input) + ";" +
10291036
getComponentStackCsv(output) + ";" + renderKind(preservesValue)

0 commit comments

Comments
 (0)