Skip to content

Commit d70d1fb

Browse files
committed
C#: Add support for the use of synthetic fields in flow summary CSV.
1 parent a43704a commit d70d1fb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ SummaryComponent interpretComponentSpecific(string c) {
136136
c.regexpCapture("Property\\[(.+)\\]", 1) = p.getQualifiedName() and
137137
result = SummaryComponent::content(any(PropertyContent pc | pc.getProperty() = p))
138138
)
139+
or
140+
exists(SyntheticField f |
141+
c.regexpCapture("SyntheticField\\[(.+)\\]", 1) = f and
142+
result = SummaryComponent::content(any(SyntheticFieldContent sfc | sfc.getField() = f))
143+
)
139144
}
140145

141146
/** Gets the textual representation of the content in the format used for flow summaries. */
@@ -145,6 +150,8 @@ private string getContentSpecificCsv(Content c) {
145150
exists(Field f | c = TFieldContent(f) and result = "Field[" + f.getQualifiedName() + "]")
146151
or
147152
exists(Property p | c = TPropertyContent(p) and result = "Property[" + p.getQualifiedName() + "]")
153+
or
154+
exists(SyntheticField f | c = TSyntheticFieldContent(f) and result = "SyntheticField[" + f + "]")
148155
}
149156

150157
/** Gets the textual representation of a summary component in the format used for flow summaries. */

0 commit comments

Comments
 (0)