Python: Add postupdate nodes for subscripts.

This drops reverse read inconsistencies on saltstack from 14909 to 1353.
This commit is contained in:
Rasmus Lerchedahl Petersen
2021-01-24 16:17:34 +01:00
parent 361bee851a
commit ad39bfb2ff
2 changed files with 3 additions and 0 deletions

View File

@@ -76,6 +76,8 @@ class ReadPreUpdateNode extends NeedsSyntheticPostUpdateNode, CfgNode {
node = a.getObject().getAFlowNode() and
a.getCtx() instanceof Load
)
or
exists(SubscriptNode s | node = s.getObject())
}
override string label() { result = "read" }

View File

@@ -8,6 +8,7 @@
| test.py:187:1:187:53 | GSSA Variable SINK | test.py:189:5:189:8 | ControlFlowNode for SINK |
| test.py:187:1:187:53 | GSSA Variable SOURCE | test.py:188:25:188:30 | ControlFlowNode for SOURCE |
| test.py:188:5:188:5 | SSA variable x | test.py:189:10:189:10 | ControlFlowNode for x |
| test.py:188:9:188:68 | ControlFlowNode for .0 | test.py:188:9:188:68 | SSA variable .0 |
| test.py:188:9:188:68 | ControlFlowNode for ListComp | test.py:188:5:188:5 | SSA variable x |
| test.py:188:9:188:68 | SSA variable .0 | test.py:188:9:188:68 | ControlFlowNode for .0 |
| test.py:188:16:188:16 | SSA variable v | test.py:188:45:188:45 | ControlFlowNode for v |