Skip to content

Commit 0451014

Browse files
committed
C++: Do not use the deprecated predicate in queries.
1 parent 1483b6a commit 0451014

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/rangeanalysis/RangeAnalysis.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ private predicate boundFlowStepPhi(
412412
or
413413
exists(IRGuardCondition guard, boolean testIsTrue |
414414
guard = boundFlowCond(valueNumberOfOperand(op2), op1, delta, upper, testIsTrue) and
415-
guard.controlsEdge(op2.getPredecessorBlock(), op2.getUse().getBlock(), testIsTrue) and
415+
guard.controlsBranchEdge(op2.getPredecessorBlock(), op2.getUse().getBlock(), testIsTrue) and
416416
reason = TCondReason(guard)
417417
)
418418
}

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/SemanticExprSpecific.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ module SemanticExprConfig {
259259
}
260260

261261
predicate guardHasBranchEdge(Guard guard, BasicBlock bb1, BasicBlock bb2, boolean branch) {
262-
guard.controlsEdge(bb1, bb2, branch)
262+
guard.controlsBranchEdge(bb1, bb2, branch)
263263
}
264264

265265
Guard comparisonGuard(Expr e) { getSemanticExpr(result) = e }

cpp/ql/src/Security/CWE/CWE-129/ImproperArrayIndexValidation.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ predicate isFlowSource(FS::FlowSource source, string sourceType) {
2626
predicate guardChecks(IRGuardCondition g, Expr e, boolean branch) {
2727
exists(Operand op | op.getDef().getConvertedResultExpression() = e |
2828
// `op < k` is true and `k > 0`
29-
g.comparesLt(op, any(int k | k > 0), true, any(BooleanValue bv | bv.getValue() = branch))
29+
g.comparesLt(op, any(int k | k > 0), true, any(GuardValue bv | bv.asBooleanValue() = branch))
3030
or
3131
// `op < _ + k` is true and `k > 0`.
3232
g.comparesLt(op, _, any(int k | k > 0), true, branch)
3333
or
3434
// op == k
35-
g.comparesEq(op, _, true, any(BooleanValue bv | bv.getValue() = branch))
35+
g.comparesEq(op, _, true, any(GuardValue bv | bv.asBooleanValue() = branch))
3636
or
3737
// op == _ + k
3838
g.comparesEq(op, _, _, true, branch)

0 commit comments

Comments
 (0)