@@ -1067,19 +1067,18 @@ predicate comprehensionStoreStep(CfgNode nodeFrom, Content c, CfgNode nodeTo) {
10671067}
10681068
10691069/**
1070- * Holds if `nodeFrom` flows into an attribute (corresponding to `c`) of `nodeTo` via an attribute assignment.
1070+ * Holds if `nodeFrom` flows into the attribute `c` of `nodeTo` via an attribute assignment.
10711071 *
10721072 * For example, in
10731073 * ```python
10741074 * obj.foo = x
10751075 * ```
1076- * data flows from `x` to (the post-update node for) `obj` via assignment to `foo `.
1076+ * data flows from `x` to the attribute `foo` of (the post-update node for) `obj`.
10771077 */
1078- predicate attributeStoreStep ( CfgNode nodeFrom , AttributeContent c , PostUpdateNode nodeTo ) {
1079- exists ( AttrNode attr |
1080- nodeFrom .asCfgNode ( ) = attr .( DefinitionNode ) .getValue ( ) and
1081- attr .getName ( ) = c .getAttribute ( ) and
1082- attr .getObject ( ) = nodeTo .getPreUpdateNode ( ) .( CfgNode ) .getNode ( )
1078+ predicate attributeStoreStep ( Node nodeFrom , AttributeContent c , PostUpdateNode nodeTo ) {
1079+ exists ( AttrWrite write |
1080+ write .accesses ( nodeTo .getPreUpdateNode ( ) , c .getAttribute ( ) ) and
1081+ nodeFrom = write .getValue ( )
10831082 )
10841083}
10851084
@@ -1923,21 +1922,16 @@ pragma[noinline]
19231922TupleElementContent small_tuple ( ) { result .getIndex ( ) <= 7 }
19241923
19251924/**
1926- * Holds if `nodeTo` is a read of an attribute (corresponding to `c`) of the object in `nodeFrom`.
1925+ * Holds if `nodeTo` is a read of the attribute `c` of the object `nodeFrom`.
19271926 *
1928- * For example, in
1927+ * For example
19291928 * ```python
19301929 * obj.foo
19311930 * ```
1932- * data flows from `obj` to `obj. foo` via a read from `foo `.
1931+ * is a read of the attribute ` foo` from the object `obj `.
19331932 */
1934- predicate attributeReadStep ( CfgNode nodeFrom , AttributeContent c , CfgNode nodeTo ) {
1935- exists ( AttrNode attr |
1936- nodeFrom .asCfgNode ( ) = attr .getObject ( ) and
1937- nodeTo .asCfgNode ( ) = attr and
1938- attr .getName ( ) = c .getAttribute ( ) and
1939- attr .isLoad ( )
1940- )
1933+ predicate attributeReadStep ( Node nodeFrom , AttributeContent c , AttrRead nodeTo ) {
1934+ nodeTo .accesses ( nodeFrom , c .getAttribute ( ) )
19411935}
19421936
19431937/**
0 commit comments