@@ -141,7 +141,7 @@ private predicate isOpaqueType(Type type) {
141141 * Holds if an `IROpaqueType` with the specified `tag` and `byteSize` should exist.
142142 */
143143predicate hasOpaqueType ( Type tag , int byteSize ) {
144- isOpaqueType ( tag ) and byteSize = getTypeSize ( tag )
144+ isOpaqueType ( tag ) and byteSize = getTypeSize ( tag . getUnspecifiedType ( ) )
145145 or
146146 tag instanceof UnknownType and Raw:: needsUnknownOpaqueType ( byteSize )
147147}
@@ -153,17 +153,18 @@ private IRType getIRTypeForPRValue(Type type) {
153153 exists ( Type unspecifiedType | unspecifiedType = type .getUnspecifiedType ( ) |
154154 isOpaqueType ( unspecifiedType ) and
155155 exists ( IROpaqueType opaqueType | opaqueType = result |
156- opaqueType .getByteSize ( ) = getTypeSize ( type ) and
156+ opaqueType .getByteSize ( ) = getTypeSize ( unspecifiedType ) and
157157 opaqueType .getTag ( ) = unspecifiedType
158158 )
159159 or
160- unspecifiedType instanceof BoolType and result .( IRBooleanType ) .getByteSize ( ) = type .getSize ( )
160+ unspecifiedType instanceof BoolType and
161+ result .( IRBooleanType ) .getByteSize ( ) = unspecifiedType .getSize ( )
161162 or
162163 isSignedIntegerType ( unspecifiedType ) and
163- result .( IRSignedIntegerType ) .getByteSize ( ) = type .getSize ( )
164+ result .( IRSignedIntegerType ) .getByteSize ( ) = unspecifiedType .getSize ( )
164165 or
165166 isUnsignedIntegerType ( unspecifiedType ) and
166- result .( IRUnsignedIntegerType ) .getByteSize ( ) = type .getSize ( )
167+ result .( IRUnsignedIntegerType ) .getByteSize ( ) = unspecifiedType .getSize ( )
167168 or
168169 exists ( FloatingPointType floatType , IRFloatingPointType irFloatType |
169170 floatType = unspecifiedType and
@@ -173,7 +174,8 @@ private IRType getIRTypeForPRValue(Type type) {
173174 irFloatType .getDomain ( ) = floatType .getDomain ( )
174175 )
175176 or
176- isPointerIshType ( unspecifiedType ) and result .( IRAddressType ) .getByteSize ( ) = getTypeSize ( type )
177+ isPointerIshType ( unspecifiedType ) and
178+ result .( IRAddressType ) .getByteSize ( ) = getTypeSize ( unspecifiedType )
177179 or
178180 unspecifiedType instanceof FunctionPointerIshType and
179181 result .( IRFunctionAddressType ) .getByteSize ( ) = getTypeSize ( type )
0 commit comments