C++: Allow comparisons with pointer types in IRGuards.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-26 16:19:24 +01:00
parent e78091e9d0
commit b78537dd74

View File

@@ -1156,5 +1156,14 @@ private predicate add_eq(
)
}
private class IntegerOrPointerConstantInstruction extends ConstantInstruction {
IntegerOrPointerConstantInstruction() {
this instanceof IntegerConstantInstruction or
this instanceof PointerConstantInstruction
}
}
/** The int value of integer constant expression. */
private int int_value(Instruction i) { result = i.(IntegerConstantInstruction).getValue().toInt() }
private int int_value(Instruction i) {
result = i.(IntegerOrPointerConstantInstruction).getValue().toInt()
}