mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: Do not use the deprecated predicate in queries.
This commit is contained in:
@@ -412,7 +412,7 @@ private predicate boundFlowStepPhi(
|
|||||||
or
|
or
|
||||||
exists(IRGuardCondition guard, boolean testIsTrue |
|
exists(IRGuardCondition guard, boolean testIsTrue |
|
||||||
guard = boundFlowCond(valueNumberOfOperand(op2), op1, delta, upper, testIsTrue) and
|
guard = boundFlowCond(valueNumberOfOperand(op2), op1, delta, upper, testIsTrue) and
|
||||||
guard.controlsEdge(op2.getPredecessorBlock(), op2.getUse().getBlock(), testIsTrue) and
|
guard.controlsBranchEdge(op2.getPredecessorBlock(), op2.getUse().getBlock(), testIsTrue) and
|
||||||
reason = TCondReason(guard)
|
reason = TCondReason(guard)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ module SemanticExprConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
predicate guardHasBranchEdge(Guard guard, BasicBlock bb1, BasicBlock bb2, boolean branch) {
|
predicate guardHasBranchEdge(Guard guard, BasicBlock bb1, BasicBlock bb2, boolean branch) {
|
||||||
guard.controlsEdge(bb1, bb2, branch)
|
guard.controlsBranchEdge(bb1, bb2, branch)
|
||||||
}
|
}
|
||||||
|
|
||||||
Guard comparisonGuard(Expr e) { getSemanticExpr(result) = e }
|
Guard comparisonGuard(Expr e) { getSemanticExpr(result) = e }
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ predicate isFlowSource(FS::FlowSource source, string sourceType) {
|
|||||||
predicate guardChecks(IRGuardCondition g, Expr e, boolean branch) {
|
predicate guardChecks(IRGuardCondition g, Expr e, boolean branch) {
|
||||||
exists(Operand op | op.getDef().getConvertedResultExpression() = e |
|
exists(Operand op | op.getDef().getConvertedResultExpression() = e |
|
||||||
// `op < k` is true and `k > 0`
|
// `op < k` is true and `k > 0`
|
||||||
g.comparesLt(op, any(int k | k > 0), true, any(BooleanValue bv | bv.getValue() = branch))
|
g.comparesLt(op, any(int k | k > 0), true, any(GuardValue bv | bv.asBooleanValue() = branch))
|
||||||
or
|
or
|
||||||
// `op < _ + k` is true and `k > 0`.
|
// `op < _ + k` is true and `k > 0`.
|
||||||
g.comparesLt(op, _, any(int k | k > 0), true, branch)
|
g.comparesLt(op, _, any(int k | k > 0), true, branch)
|
||||||
or
|
or
|
||||||
// op == k
|
// op == k
|
||||||
g.comparesEq(op, _, true, any(BooleanValue bv | bv.getValue() = branch))
|
g.comparesEq(op, _, true, any(GuardValue bv | bv.asBooleanValue() = branch))
|
||||||
or
|
or
|
||||||
// op == _ + k
|
// op == _ + k
|
||||||
g.comparesEq(op, _, _, true, branch)
|
g.comparesEq(op, _, _, true, branch)
|
||||||
|
|||||||
Reference in New Issue
Block a user