C++: Ensure that we can construct an 'IRType' from a 'RoutineType'.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-02-27 17:41:19 +00:00
parent 892f97cd7a
commit ddd5113c02

View File

@@ -11,7 +11,7 @@ private int getTypeSizeWorkaround(Type type) {
exists(Type unspecifiedType |
unspecifiedType = type.getUnspecifiedType() and
(
unspecifiedType instanceof FunctionReferenceType and
(unspecifiedType instanceof FunctionReferenceType or unspecifiedType instanceof RoutineType) and
result = getPointerSize()
or
exists(PointerToMemberType ptmType |
@@ -176,7 +176,7 @@ private IRType getIRTypeForPRValue(Type type) {
isPointerIshType(unspecifiedType) and
result.(IRAddressType).getByteSize() = getTypeSize(unspecifiedType)
or
unspecifiedType instanceof FunctionPointerIshType and
(unspecifiedType instanceof FunctionPointerIshType or unspecifiedType instanceof RoutineType) and
result.(IRFunctionAddressType).getByteSize() = getTypeSize(type)
or
unspecifiedType instanceof VoidType and result instanceof IRVoidType