codeql
codeql copied to clipboard
Python: subscript def nodes
trafficstars
Follow on to #10539. Fix the def-nodes for subscripts.
I also experimented with recovering the index of a subscript (see the commit). I did it for the case where the subscript is being written to. This is the complicated case, because the actual SubscriptNode is not an API node:
For
header["key"] = "value"
header would be an API use node and "value" would be an API def node with path [path to header].getASubscript(). (To get the data flow node, we can then use asSink() or getAValueReachingSink() as appropriate.)