Skip to content

Commit cbd6d35

Browse files
committed
ssa: Fix bad join order
The C++ instantiation of DataFlowIntegration generated a bad join order
1 parent 2c637ab commit cbd6d35

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

‎shared/ssa/codeql/ssa/Ssa.qll‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,20 +1776,21 @@ module Make<
17761776

17771777
final class ExprPostUpdateNode = ExprPostUpdateNodeImpl;
17781778

1779-
private class ReadNodeImpl extends ExprNodeImpl {
1780-
private BasicBlock bb_;
1781-
private int i_;
1779+
pragma[nomagic]
1780+
private predicate exprReadAt(
1781+
DfInput::Expr e, BasicBlock bb, int i, SourceVariable v, boolean isPost, TExprNode node
1782+
) {
1783+
variableRead(bb, i, v, true) and
1784+
e.hasCfgNode(bb, i) and
1785+
node = TExprNode(e, v, isPost)
1786+
}
17821787

1783-
ReadNodeImpl() {
1784-
variableRead(bb_, i_, v_, true) and
1785-
this.getExpr().hasCfgNode(bb_, i_)
1786-
}
1788+
private class ReadNodeImpl extends ExprNodeImpl {
1789+
ReadNodeImpl() { exprReadAt(e, _, _, _, false, this) }
17871790

17881791
pragma[nomagic]
17891792
predicate readsAt(BasicBlock bb, int i, SourceVariable v) {
1790-
bb = bb_ and
1791-
i = i_ and
1792-
v = v_
1793+
exprReadAt(e, bb, i, v, false, this)
17931794
}
17941795
}
17951796

0 commit comments

Comments
 (0)