Python: Add comment about reverse reads.

This commit is contained in:
Rasmus Lerchedahl Petersen
2021-01-26 12:11:21 +01:00
parent dacc21d0b5
commit e253855999

View File

@@ -69,7 +69,17 @@ class StorePreUpdateNode extends NeedsSyntheticPostUpdateNode, CfgNode {
override string label() { result = "store" }
}
/** A node marking the state change of an object after a read. */
/**
* A node marking the state change of an object after a read.
*
* A reverse read happens when the result of a read is modified, e.g. in
* ```python
* l = [ mutable ]
* l[0].mutate()
* ```
* we may now have changed the content of `l`. To track this, there must be
* a postupdate node for `l`.
*/
class ReadPreUpdateNode extends NeedsSyntheticPostUpdateNode, CfgNode {
ReadPreUpdateNode() {
exists(Attribute a |