Skip to content

Commit fa36d9f

Browse files
authored
Merge pull request #20438 from MathiasVP/remove-antijoin-in-shared-guards
Shared: Remove antijoin from `Guards.qll`
2 parents 0ceb2f3 + 18c96fd commit fa36d9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

shared/controlflow/codeql/controlflow/Guards.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,13 +731,14 @@ module Make<
731731
private predicate impliesStep1(Guard g1, GuardValue v1, Guard g2, GuardValue v2) {
732732
baseImpliesStep(g1, v1, g2, v2)
733733
or
734-
exists(SsaDefinition def, Expr e |
734+
exists(SsaDefinition def, Expr e, BasicBlock bb1 |
735735
// If `def = g2 ? v1 : ...` and all other assignments to `def` are different from
736736
// `v1` then a guard proving `def == v1` ensures that `g2` evaluates to `v2`.
737737
uniqueValue(def, e, v1) and
738738
guardReadsSsaVar(g1, def) and
739739
g2.directlyValueControls(e.getBasicBlock(), v2) and
740-
not g2.directlyValueControls(g1.getBasicBlock(), v2)
740+
bb1 = g1.getBasicBlock() and
741+
not g2.directlyValueControls(bb1, v2)
741742
)
742743
or
743744
exists(int k, boolean upper |

0 commit comments

Comments
 (0)