Skip to content

Commit 9ea99f8

Browse files
committed
ssa: Only materialise if Expr is reachable (for some variable)
1 parent 82c2e5b commit 9ea99f8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,11 @@ module Make<
16831683
TExprNode(DfInput::Expr e, SourceVariable v, Boolean isPost) {
16841684
exists(BasicBlock bb, int i |
16851685
e.hasCfgNode(bb, i) and
1686-
variableRead(bb, i, v, true)
1686+
variableRead(bb, i, v, true) and
1687+
// Only materialise if 'expr' has a reaching definition.
1688+
// Note that the read may correspond to a different variable than 'v', but the C++
1689+
// instantiation currently expects this particular behaviour.
1690+
DfInput::getARead(_) = e
16871691
)
16881692
} or
16891693
TSsaDefinitionNode(DefinitionExt def) {

0 commit comments

Comments
 (0)