Skip to content

Commit 024c5cf

Browse files
committed
Swift: add MaD print support for EnumElement
1 parent 0142309 commit 024c5cf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ private string getContentSpecific(ContentSet cs) {
110110
result = "Field[" + c.getField().getName() + "]"
111111
)
112112
or
113+
exists(Content::EnumContent c |
114+
cs.isSingleton(c) and
115+
result = "EnumElement[" + c.getSignature() + "]"
116+
)
117+
or
113118
exists(Content::ArrayContent c |
114119
cs.isSingleton(c) and
115120
result = "ArrayElement"
@@ -130,6 +135,15 @@ string getMadRepresentationSpecific(SummaryComponent sc) {
130135
not rk = getReturnValueKind() and
131136
result = "ReturnValue" + "[" + rk + "]"
132137
)
138+
or
139+
exists(ContentSet c |
140+
sc = TWithoutContentSummaryComponent(c) and
141+
result = "WithoutContent" + c.toString()
142+
) or
143+
exists(ContentSet c |
144+
sc = TWithContentSummaryComponent(c) and
145+
result = "WithContent" + c.toString()
146+
)
133147
}
134148

135149
/** Gets the textual representation of a parameter position in the format used for flow summaries. */

0 commit comments

Comments
 (0)