Skip to content

Commit 0648771

Browse files
committed
Python: interpret remaining content
1 parent c111066 commit 0648771

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImplSpecific.qll

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,27 @@ predicate neutralSummaryElement(FlowSummary::SummarizedCallable c, string proven
105105
SummaryComponent interpretComponentSpecific(AccessPathToken c) {
106106
c = "ListElement" and
107107
result = FlowSummary::SummaryComponent::listElement()
108+
or
109+
c = "SetElement" and
110+
result = FlowSummary::SummaryComponent::setElement()
111+
or
112+
exists(int index |
113+
c.getAnArgument("TupleElement") = index.toString() and
114+
result = FlowSummary::SummaryComponent::tupleElement(index)
115+
)
116+
or
117+
exists(string key |
118+
c.getAnArgument("DictionaryElement") = key and
119+
result = FlowSummary::SummaryComponent::dictionaryElement(key)
120+
)
121+
or
122+
c = "DictionaryElementAny" and
123+
result = FlowSummary::SummaryComponent::dictionaryElementAny()
124+
or
125+
exists(string attr |
126+
c.getAnArgument("Attribute") = attr and
127+
result = FlowSummary::SummaryComponent::attribute(attr)
128+
)
108129
}
109130

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

0 commit comments

Comments
 (0)