@@ -201,7 +201,7 @@ module EssaFlow {
201201 nodeFrom .asCfgNode ( ) = nodeTo .asCfgNode ( ) .( IfExprNode ) .getAnOperand ( )
202202 or
203203 // Flow inside an unpacking assignment
204- unpackingAssignmentFlowStep ( nodeFrom , nodeTo )
204+ iterableUnpackingFlowStep ( nodeFrom , nodeTo )
205205 or
206206 // Overflow keyword argument
207207 exists ( CallNode call , CallableValue callable |
@@ -898,7 +898,7 @@ predicate storeStep(Node nodeFrom, Content c, Node nodeTo) {
898898 or
899899 comprehensionStoreStep ( nodeFrom , c , nodeTo )
900900 or
901- unpackingAssignmentStoreStep ( nodeFrom , c , nodeTo )
901+ iterableUnpackingStoreStep ( nodeFrom , c , nodeTo )
902902 or
903903 attributeStoreStep ( nodeFrom , c , nodeTo )
904904 or
@@ -1032,7 +1032,7 @@ predicate kwOverflowStoreStep(CfgNode nodeFrom, DictionaryElementContent c, Node
10321032predicate readStep ( Node nodeFrom , Content c , Node nodeTo ) {
10331033 subscriptReadStep ( nodeFrom , c , nodeTo )
10341034 or
1035- unpackingAssignmentReadStep ( nodeFrom , c , nodeTo )
1035+ iterableUnpackingReadStep ( nodeFrom , c , nodeTo )
10361036 or
10371037 popReadStep ( nodeFrom , c , nodeTo )
10381038 or
@@ -1234,7 +1234,7 @@ predicate subscriptReadStep(CfgNode nodeFrom, Content c, CfgNode nodeTo) {
12341234 *
12351235 * `c`: [ListElementContent]
12361236 */
1237- module UnpackingAssignment {
1237+ module IterableUnpacking {
12381238 /**
12391239 * The target of a `for`, e.g. `x` in `for x in list` or in `[42 for x in list]`.
12401240 * This class also records the source, which in both above cases is `list`.
@@ -1309,7 +1309,7 @@ module UnpackingAssignment {
13091309 * Step 1a
13101310 * Data flows from `iterable` to `TIterableSequence(sequence)`
13111311 */
1312- predicate unpackingAssignmentAssignmentFlowStep ( Node nodeFrom , Node nodeTo ) {
1312+ predicate iterableUnpackingAssignmentFlowStep ( Node nodeFrom , Node nodeTo ) {
13131313 exists ( AssignmentTarget target |
13141314 nodeFrom .asExpr ( ) = target .getValue ( ) and
13151315 nodeTo = TIterableSequenceNode ( target )
@@ -1320,7 +1320,7 @@ module UnpackingAssignment {
13201320 * Step 1b
13211321 * Data is read from `iterable` to `TIterableSequence(sequence)`
13221322 */
1323- predicate unpackingAssignmentForReadStep ( CfgNode nodeFrom , Content c , Node nodeTo ) {
1323+ predicate iterableUnpackingForReadStep ( CfgNode nodeFrom , Content c , Node nodeTo ) {
13241324 exists ( ForTarget target |
13251325 nodeFrom .asExpr ( ) = target .getSource ( ) and
13261326 nodeTo = TIterableSequenceNode ( target .( SequenceNode ) )
@@ -1336,7 +1336,7 @@ module UnpackingAssignment {
13361336 * Step 2
13371337 * Data flows from `TIterableSequence(sequence)` to `sequence`
13381338 */
1339- predicate unpackingAssignmentTupleFlowStep ( Node nodeFrom , Node nodeTo ) {
1339+ predicate iterableUnpackingTupleFlowStep ( Node nodeFrom , Node nodeTo ) {
13401340 exists ( UnpackingAssignmentSequenceTarget target |
13411341 nodeFrom = TIterableSequenceNode ( target ) and
13421342 nodeTo .asCfgNode ( ) = target
@@ -1349,7 +1349,7 @@ module UnpackingAssignment {
13491349 * As `sequence` is modeled as a tuple, we will not read tuple content as that would allow
13501350 * crosstalk.
13511351 */
1352- predicate unpackingAssignmentConvertingReadStep ( Node nodeFrom , Content c , Node nodeTo ) {
1352+ predicate iterableUnpackingConvertingReadStep ( Node nodeFrom , Content c , Node nodeTo ) {
13531353 exists ( UnpackingAssignmentSequenceTarget target |
13541354 nodeFrom = TIterableSequenceNode ( target ) and
13551355 nodeTo = TIterableElementNode ( target ) and
@@ -1368,7 +1368,7 @@ module UnpackingAssignment {
13681368 * Content type is `TupleElementContent` with indices taken from the syntax.
13691369 * For instance, if `sequence` is `(a, *b, c)`, content is written to index 0, 1, and 2.
13701370 */
1371- predicate unpackingAssignmentConvertingStoreStep ( Node nodeFrom , Content c , Node nodeTo ) {
1371+ predicate iterableUnpackingConvertingStoreStep ( Node nodeFrom , Content c , Node nodeTo ) {
13721372 exists ( UnpackingAssignmentSequenceTarget target |
13731373 nodeFrom = TIterableElementNode ( target ) and
13741374 nodeTo .asCfgNode ( ) = target and
@@ -1388,7 +1388,7 @@ module UnpackingAssignment {
13881388 *
13891389 * c) If the element is a starred variable, with control-flow node `v`, `toNode` is `TIterableElement(v)`.
13901390 */
1391- predicate unpackingAssignmentElementReadStep ( Node nodeFrom , Content c , Node nodeTo ) {
1391+ predicate iterableUnpackingElementReadStep ( Node nodeFrom , Content c , Node nodeTo ) {
13921392 exists (
13931393 UnpackingAssignmentSequenceTarget target , int index , ControlFlowNode element , int starIndex
13941394 |
@@ -1430,7 +1430,7 @@ module UnpackingAssignment {
14301430 * Data flows from `TIterableElement(v)` to the essa variable for `v`, with
14311431 * content type `ListElementContent`.
14321432 */
1433- predicate unpackingAssignmentStarredElementStoreStep ( Node nodeFrom , Content c , Node nodeTo ) {
1433+ predicate iterableUnpackingStarredElementStoreStep ( Node nodeFrom , Content c , Node nodeTo ) {
14341434 exists ( ControlFlowNode starred | starred .getNode ( ) instanceof Starred |
14351435 nodeFrom = TIterableElementNode ( starred ) and
14361436 nodeTo .asVar ( ) .getDefinition ( ) .( MultiAssignmentDefinition ) .getDefiningNode ( ) = starred and
@@ -1439,30 +1439,30 @@ module UnpackingAssignment {
14391439 }
14401440
14411441 /** All read steps associated with unpacking assignment. */
1442- predicate unpackingAssignmentReadStep ( Node nodeFrom , Content c , Node nodeTo ) {
1443- unpackingAssignmentForReadStep ( nodeFrom , c , nodeTo )
1442+ predicate iterableUnpackingReadStep ( Node nodeFrom , Content c , Node nodeTo ) {
1443+ iterableUnpackingForReadStep ( nodeFrom , c , nodeTo )
14441444 or
1445- unpackingAssignmentElementReadStep ( nodeFrom , c , nodeTo )
1445+ iterableUnpackingElementReadStep ( nodeFrom , c , nodeTo )
14461446 or
1447- unpackingAssignmentConvertingReadStep ( nodeFrom , c , nodeTo )
1447+ iterableUnpackingConvertingReadStep ( nodeFrom , c , nodeTo )
14481448 }
14491449
14501450 /** All store steps associated with unpacking assignment. */
1451- predicate unpackingAssignmentStoreStep ( Node nodeFrom , Content c , Node nodeTo ) {
1452- unpackingAssignmentStarredElementStoreStep ( nodeFrom , c , nodeTo )
1451+ predicate iterableUnpackingStoreStep ( Node nodeFrom , Content c , Node nodeTo ) {
1452+ iterableUnpackingStarredElementStoreStep ( nodeFrom , c , nodeTo )
14531453 or
1454- unpackingAssignmentConvertingStoreStep ( nodeFrom , c , nodeTo )
1454+ iterableUnpackingConvertingStoreStep ( nodeFrom , c , nodeTo )
14551455 }
14561456
14571457 /** All flow steps associated with unpacking assignment. */
1458- predicate unpackingAssignmentFlowStep ( Node nodeFrom , Node nodeTo ) {
1459- unpackingAssignmentAssignmentFlowStep ( nodeFrom , nodeTo )
1458+ predicate iterableUnpackingFlowStep ( Node nodeFrom , Node nodeTo ) {
1459+ iterableUnpackingAssignmentFlowStep ( nodeFrom , nodeTo )
14601460 or
1461- unpackingAssignmentTupleFlowStep ( nodeFrom , nodeTo )
1461+ iterableUnpackingTupleFlowStep ( nodeFrom , nodeTo )
14621462 }
14631463}
14641464
1465- import UnpackingAssignment
1465+ import IterableUnpacking
14661466
14671467/** Data flows from a sequence to a call to `pop` on the sequence. */
14681468predicate popReadStep ( CfgNode nodeFrom , Content c , CfgNode nodeTo ) {
0 commit comments