Skip to content

Commit 4352757

Browse files
committed
C++: Fix back edge detection for phi nodes.
1 parent faf846b commit 4352757

File tree

3 files changed

+114
-6
lines changed

3 files changed

+114
-6
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ class SsaPhiNode extends Node, TSsaPhiNode {
552552
*/
553553
final Node getAnInput(boolean fromBackEdge) {
554554
localFlowStep(result, this) and
555-
if phi.getBasicBlock().dominates(result.getBasicBlock())
555+
if phi.getBasicBlock().strictlyDominates(result.getBasicBlock())
556556
then fromBackEdge = true
557557
else fromBackEdge = false
558558
}

0 commit comments

Comments
 (0)