Skip to content

Commit c1c4a5b

Browse files
committed
Rangeanalysis: Copy qldoc and simplification from Java.
1 parent cd44d67 commit c1c4a5b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,11 @@ module RangeStage<
10471047
)
10481048
}
10491049

1050+
/**
1051+
* Holds if `b + delta` is a valid bound for `phi`'s `rix`th input edge.
1052+
* - `upper = true` : `phi <= b + delta`
1053+
* - `upper = false` : `phi >= b + delta`
1054+
*/
10501055
pragma[nomagic]
10511056
private predicate boundedPhiRankStep(
10521057
Sem::SsaPhiNode phi, SemBound b, D::Delta delta, boolean upper, boolean fromBackEdge,
@@ -1056,9 +1061,9 @@ module RangeStage<
10561061
rankedPhiInput(phi, inp, edge, rix) and
10571062
boundedPhiCandValidForEdge(phi, b, delta, upper, fromBackEdge, origdelta, reason, inp, edge)
10581063
|
1059-
if rix = 1
1060-
then any()
1061-
else boundedPhiRankStep(phi, b, delta, upper, fromBackEdge, origdelta, reason, rix - 1)
1064+
rix = 1
1065+
or
1066+
boundedPhiRankStep(phi, b, delta, upper, fromBackEdge, origdelta, reason, rix - 1)
10621067
)
10631068
}
10641069

0 commit comments

Comments
 (0)