mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: Fixup tests.
This commit is contained in:
@@ -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 = " >= "
|
||||
|
||||
@@ -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 = " >= "
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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*())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user