C++: Do not use the deprecated predicate in queries.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-09-17 17:30:39 +01:00
parent 5e82eb9b24
commit d8f34dba17
3 changed files with 4 additions and 4 deletions

View File

@@ -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)
) )
} }

View File

@@ -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 }

View File

@@ -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)