File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
python/ql/lib/semmle/python/dataflow/new/internal Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,30 @@ SummaryComponent interpretComponentSpecific(AccessPathToken c) {
128128 )
129129}
130130
131+ private string getContentSpecific ( Content cs ) {
132+ cs = TListElementContent ( ) and result = "ListElement"
133+ or
134+ cs = TSetElementContent ( ) and result = "SetElement"
135+ or
136+ exists ( int index |
137+ cs = TTupleElementContent ( index ) and result = "TupleElement[" + index .toString ( ) + "]"
138+ )
139+ or
140+ exists ( string key |
141+ cs = TDictionaryElementContent ( key ) and result = "DictionaryElement[" + key + "]"
142+ )
143+ or
144+ cs = TDictionaryElementAnyContent ( ) and result = "DictionaryElementAny"
145+ or
146+ exists ( string attr | cs = TAttributeContent ( attr ) and result = "Attribute[" + attr + "]" )
147+ }
148+
131149/** Gets the textual representation of a summary component in the format used for flow summaries. */
132150string getAccessStepSpecific ( SummaryComponent sc ) {
133- sc = TContentSummaryComponent ( any ( ListElementContent c ) ) and
134- result = "ListElement"
151+ exists ( Content c |
152+ sc = TContentSummaryComponent ( c ) and
153+ result = getContentSpecific ( c )
154+ )
135155}
136156
137157/** Gets the textual representation of a parameter position in the format used for flow summaries. */
You can’t perform that action at this time.
0 commit comments