Skip to content

Commit a40f0e0

Browse files
committed
Python: Fix bad join ordering in ControlFlowNode::getAChild().
1 parent 01ce344 commit a40f0e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ql/src/semmle/python/Flow.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,14 @@ class ControlFlowNode extends @py_flow_node {
402402
}
403403

404404
ControlFlowNode getAChild() {
405-
result = this.getExprChild() and
406-
result.getBasicBlock().dominates(this.getBasicBlock())
405+
result = this.getExprChild(this.getBasicBlock())
407406
}
408407

409408
/* join-ordering helper for `getAChild() */
410409
pragma [noinline]
411-
private ControlFlowNode getExprChild() {
410+
private ControlFlowNode getExprChild(BasicBlock dom) {
412411
this.getNode().(Expr).getAChildNode() = result.getNode() and
412+
result.getBasicBlock().dominates(dom) and
413413
not this instanceof UnaryExprNode
414414
}
415415

0 commit comments

Comments
 (0)