Skip to content

Commit ddd5113

Browse files
committed
C++: Ensure that we can construct an 'IRType' from a 'RoutineType'.
1 parent 892f97c commit ddd5113

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/lib/semmle/code/cpp/ir/internal/CppType.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private int getTypeSizeWorkaround(Type type) {
1111
exists(Type unspecifiedType |
1212
unspecifiedType = type.getUnspecifiedType() and
1313
(
14-
unspecifiedType instanceof FunctionReferenceType and
14+
(unspecifiedType instanceof FunctionReferenceType or unspecifiedType instanceof RoutineType) and
1515
result = getPointerSize()
1616
or
1717
exists(PointerToMemberType ptmType |
@@ -176,7 +176,7 @@ private IRType getIRTypeForPRValue(Type type) {
176176
isPointerIshType(unspecifiedType) and
177177
result.(IRAddressType).getByteSize() = getTypeSize(unspecifiedType)
178178
or
179-
unspecifiedType instanceof FunctionPointerIshType and
179+
(unspecifiedType instanceof FunctionPointerIshType or unspecifiedType instanceof RoutineType) and
180180
result.(IRFunctionAddressType).getByteSize() = getTypeSize(type)
181181
or
182182
unspecifiedType instanceof VoidType and result instanceof IRVoidType

0 commit comments

Comments
 (0)