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

This commit is contained in:
Mathias Vorreiter Pedersen 2024-04-26 16:19:24 +01:00
Родитель e78091e9d0
Коммит b78537dd74
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

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