Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e253855

Browse files
committed
Python: Add comment about reverse reads.
1 parent dacc21d commit e253855

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

python/ql/src/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,17 @@ class StorePreUpdateNode extends NeedsSyntheticPostUpdateNode, CfgNode {
6969
override string label() { result = "store" }
7070
}
7171

72-
/** A node marking the state change of an object after a read. */
72+
/**
73+
* A node marking the state change of an object after a read.
74+
*
75+
* A reverse read happens when the result of a read is modified, e.g. in
76+
* ```python
77+
* l = [ mutable ]
78+
* l[0].mutate()
79+
* ```
80+
* we may now have changed the content of `l`. To track this, there must be
81+
* a postupdate node for `l`.
82+
*/
7383
class ReadPreUpdateNode extends NeedsSyntheticPostUpdateNode, CfgNode {
7484
ReadPreUpdateNode() {
7585
exists(Attribute a |

0 commit comments

Comments
 (0)