Skip to content

Commit c03f189

Browse files
authored
Merge pull request #7434 from MathiasVP/fix-join-order-in-phi-node
C++: Fix join-order in `phi_node` predicate.
2 parents 5054d5b + 45753e5 commit c03f189

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/SSAUtils.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ library class SSAHelper extends int {
153153
* Modern Compiler Implementation by Andrew Appel.
154154
*/
155155
private predicate frontier_phi_node(StackVariable v, BasicBlock b) {
156-
exists(BasicBlock x | dominanceFrontier(x, b) and ssa_defn_rec(v, x)) and
156+
exists(BasicBlock x |
157+
dominanceFrontier(x, b) and ssa_defn_rec(pragma[only_bind_into](v), pragma[only_bind_into](x))
158+
) and
157159
/* We can also eliminate those nodes where the variable is not live on any incoming edge */
158-
live_at_start_of_bb(v, b)
160+
live_at_start_of_bb(pragma[only_bind_into](v), b)
159161
}
160162

161163
private predicate ssa_defn_rec(StackVariable v, BasicBlock b) {

0 commit comments

Comments
 (0)