@@ -1067,19 +1067,18 @@ predicate comprehensionStoreStep(CfgNode nodeFrom, Content c, CfgNode nodeTo) {
1067
1067
}
1068
1068
1069
1069
/**
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.
1071
1071
*
1072
1072
* For example, in
1073
1073
* ```python
1074
1074
* obj.foo = x
1075
1075
* ```
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`.
1077
1077
*/
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 ( )
1083
1082
)
1084
1083
}
1085
1084
@@ -1923,21 +1922,16 @@ pragma[noinline]
1923
1922
TupleElementContent small_tuple ( ) { result .getIndex ( ) <= 7 }
1924
1923
1925
1924
/**
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`.
1927
1926
*
1928
- * For example, in
1927
+ * For example
1929
1928
* ```python
1930
1929
* obj.foo
1931
1930
* ```
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 `.
1933
1932
*/
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 ( ) )
1941
1935
}
1942
1936
1943
1937
/**
0 commit comments