Skip to content

Commit fc2d9f3

Browse files
committed
ssa: Create TExprNode even if its read has no reaching def
C++ has a subtle dependency on this behavior. Previously, when a single TExprNode corresponded to multiple variables, it would be materialised if just one of those variables had a reaching definition. Now the node has been split up, which generally works fine for C++, but in some cases one of the split-off nodes is missing its reaching def, but C++ still needs to find the flow to its next use, and therefore needs the node to be materialised.
1 parent 32e5525 commit fc2d9f3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,9 +1681,9 @@ module Make<
16811681
private newtype TNode =
16821682
TWriteDefSource(WriteDefinition def) { DfInput::ssaDefHasSource(def) } or
16831683
TExprNode(DfInput::Expr e, SourceVariable v, Boolean isPost) {
1684-
exists(Definition def |
1685-
def.getSourceVariable() = v and
1686-
e = DfInput::getARead(def)
1684+
exists(BasicBlock bb, int i |
1685+
e.hasCfgNode(bb, i) and
1686+
variableRead(bb, i, v, true)
16871687
)
16881688
} or
16891689
TSsaDefinitionNode(DefinitionExt def) {

0 commit comments

Comments
 (0)