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

Skip to content

Commit 175e43d

Browse files
committed
Python: Slight refactor
1 parent 5f189a7 commit 175e43d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,17 +1170,17 @@ module UnpackingAssignment {
11701170
UnpackingAssignmentTarget() {
11711171
this instanceof UnpackingAssignmentDirectTarget
11721172
or
1173-
this = any(UnpackingAssignmentTarget parent).getAnElement()
1173+
this = any(UnpackingAssignmentSequenceTarget parent).getAnElement()
11741174
}
1175-
1176-
ControlFlowNode getElement(int i) { result = this.(SequenceNode).getElement(i) }
1177-
1178-
ControlFlowNode getAnElement() { result = this.getElement(_) }
11791175
}
11801176

11811177
/** A (possibly recursive) target of an unpacking assignment which is also a sequence. */
11821178
class UnpackingAssignmentSequenceTarget extends UnpackingAssignmentTarget {
11831179
UnpackingAssignmentSequenceTarget() { this instanceof SequenceNode }
1180+
1181+
ControlFlowNode getElement(int i) { result = this.(SequenceNode).getElement(i) }
1182+
1183+
ControlFlowNode getAnElement() { result = this.getElement(_) }
11841184
}
11851185

11861186
/** Step 2 */
@@ -1231,8 +1231,8 @@ module UnpackingAssignment {
12311231

12321232
/** Step 5 */
12331233
predicate unpackingAssignmentElementReadStep(Node nodeFrom, Content c, Node nodeTo) {
1234-
exists(UnpackingAssignmentTarget target, int index, ControlFlowNode element, boolean precise |
1235-
target instanceof SequenceNode
1234+
exists(
1235+
UnpackingAssignmentSequenceTarget target, int index, ControlFlowNode element, boolean precise
12361236
|
12371237
nodeFrom.asCfgNode() = target and
12381238
element = target.getElement(index) and

0 commit comments

Comments
 (0)