Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb7369e

Browse files
committed
C++: Use new back-edge def. in range analysis
By using this new definition of back edges, the range analysis should work on code that uses unstructured `goto`s.
1 parent b40acce commit bb7369e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

cpp/ql/src/semmle/code/cpp/rangeanalysis/RangeUtils.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,5 @@ predicate isReducibleCFG(Function f) {
8181

8282
predicate backEdge(PhiInstruction phi, PhiOperand op) {
8383
phi.getAnOperand() = op and
84-
phi.getBlock().dominates(op.getPredecessorBlock())
85-
// TODO: identify backedges during IR construction
86-
}
84+
phi.getBlock() = op.getPredecessorBlock().getBackEdgeSuccessor(_)
85+
}

0 commit comments

Comments
 (0)