C++: Fixup tests.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-09-17 16:42:15 +01:00
parent 9ed8b75c5d
commit 0b81fbbb2b
5 changed files with 6 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ query predicate astGuardsCompare(int startLine, string msg) {
)
)
or
exists(AbstractValue value |
exists(GuardValue value |
guard.comparesEq(left, k, true, value) and op = " == "
or
guard.comparesEq(left, k, false, value) and op = " != "
@@ -95,7 +95,7 @@ query predicate irGuardsCompare(int startLine, string msg) {
)
)
or
exists(AbstractValue value |
exists(GuardValue value |
guard.comparesLt(left, k, true, value) and op = " < "
or
guard.comparesLt(left, k, false, value) and op = " >= "

View File

@@ -27,7 +27,7 @@ where
)
)
or
exists(AbstractValue value |
exists(GuardValue value |
guard.comparesLt(left, k, true, value) and op = " < "
or
guard.comparesLt(left, k, false, value) and op = " >= "

View File

@@ -7,6 +7,6 @@
import cpp
import semmle.code.cpp.controlflow.Guards
from GuardCondition guard, AbstractValue value, BasicBlock block
from GuardCondition guard, GuardValue value, BasicBlock block
where guard.valueControls(block, value)
select guard, value, block

View File

@@ -17,7 +17,7 @@ module IRTestAllocationConfig implements DataFlow::ConfigSig {
}
predicate isBarrier(DataFlow::Node node) {
exists(GuardCondition gc | node.asExpr() = gc.getAChild*())
exists(GuardCondition gc | node.asExpr() = gc.(Expr).getAChild*())
}
}

View File

@@ -7,7 +7,7 @@ predicate instructionGuardChecks(IRGuardCondition gc, Instruction checked, boole
exists(CallInstruction call |
call.getStaticCallTarget().hasName("checkArgument") and
checked = call.getAnArgument() and
gc.comparesEq(call.getAUse(), 0, false, any(BooleanValue bv | bv.getValue() = branch))
gc.comparesEq(call.getAUse(), 0, false, any(GuardValue bv | bv.asBooleanValue() = branch))
)
}