Skip to content

Commit 3a7b80d

Browse files
committed
C++: Respond to review comments.
1 parent 97aa301 commit 3a7b80d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class GuardCondition extends Expr {
134134

135135
/**
136136
* Holds if (determined by this guard) `e < k` must be `isLessThan` in `block`.
137-
* If `isLessThan = false` then this implies `left >= k`.
137+
* If `isLessThan = false` then this implies `e >= k`.
138138
*/
139139
cached
140140
predicate ensuresLt(Expr e, int k, BasicBlock block, boolean isLessThan) { none() }
@@ -256,7 +256,6 @@ private class GuardConditionFromIR extends GuardCondition {
256256
this.controlsBlock(controlled, v)
257257
}
258258

259-
/** Holds if (determined by this guard) `left < right + k` evaluates to `isLessThan` if this expression evaluates to `testIsTrue`. */
260259
override predicate comparesLt(Expr left, Expr right, int k, boolean isLessThan, boolean testIsTrue) {
261260
exists(Instruction li, Instruction ri |
262261
li.getUnconvertedResultExpression() = left and
@@ -265,21 +264,13 @@ private class GuardConditionFromIR extends GuardCondition {
265264
)
266265
}
267266

268-
/**
269-
* Holds if (determined by this guard) `e < k` evaluates to `isLessThan` if
270-
* this expression evaluates to `value`.
271-
*/
272267
override predicate comparesLt(Expr e, int k, boolean isLessThan, AbstractValue value) {
273268
exists(Instruction i |
274269
i.getUnconvertedResultExpression() = e and
275270
ir.comparesLt(i.getAUse(), k, isLessThan, value)
276271
)
277272
}
278273

279-
/**
280-
* Holds if (determined by this guard) `left < right + k` must be `isLessThan` in `block`.
281-
* If `isLessThan = false` then this implies `left >= right + k`.
282-
*/
283274
override predicate ensuresLt(Expr left, Expr right, int k, BasicBlock block, boolean isLessThan) {
284275
exists(Instruction li, Instruction ri, boolean testIsTrue |
285276
li.getUnconvertedResultExpression() = left and
@@ -289,10 +280,6 @@ private class GuardConditionFromIR extends GuardCondition {
289280
)
290281
}
291282

292-
/**
293-
* Holds if (determined by this guard) `e < k` must be `isLessThan` in `block`.
294-
* If `isLessThan = false` then this implies `e >= k`.
295-
*/
296283
override predicate ensuresLt(Expr e, int k, BasicBlock block, boolean isLessThan) {
297284
exists(Instruction i, AbstractValue value |
298285
i.getUnconvertedResultExpression() = e and
@@ -301,7 +288,6 @@ private class GuardConditionFromIR extends GuardCondition {
301288
)
302289
}
303290

304-
/** Holds if (determined by this guard) `left == right + k` evaluates to `areEqual` if this expression evaluates to `testIsTrue`. */
305291
override predicate comparesEq(Expr left, Expr right, int k, boolean areEqual, boolean testIsTrue) {
306292
exists(Instruction li, Instruction ri |
307293
li.getUnconvertedResultExpression() = left and
@@ -310,10 +296,6 @@ private class GuardConditionFromIR extends GuardCondition {
310296
)
311297
}
312298

313-
/**
314-
* Holds if (determined by this guard) `left == right + k` must be `areEqual` in `block`.
315-
* If `areEqual = false` then this implies `left != right + k`.
316-
*/
317299
override predicate ensuresEq(Expr left, Expr right, int k, BasicBlock block, boolean areEqual) {
318300
exists(Instruction li, Instruction ri, boolean testIsTrue |
319301
li.getUnconvertedResultExpression() = left and

0 commit comments

Comments
 (0)