@@ -141,7 +141,7 @@ private predicate isOpaqueType(Type type) {
141
141
* Holds if an `IROpaqueType` with the specified `tag` and `byteSize` should exist.
142
142
*/
143
143
predicate hasOpaqueType ( Type tag , int byteSize ) {
144
- isOpaqueType ( tag ) and byteSize = getTypeSize ( tag )
144
+ isOpaqueType ( tag ) and byteSize = getTypeSize ( tag . getUnspecifiedType ( ) )
145
145
or
146
146
tag instanceof UnknownType and Raw:: needsUnknownOpaqueType ( byteSize )
147
147
}
@@ -153,17 +153,18 @@ private IRType getIRTypeForPRValue(Type type) {
153
153
exists ( Type unspecifiedType | unspecifiedType = type .getUnspecifiedType ( ) |
154
154
isOpaqueType ( unspecifiedType ) and
155
155
exists ( IROpaqueType opaqueType | opaqueType = result |
156
- opaqueType .getByteSize ( ) = getTypeSize ( type ) and
156
+ opaqueType .getByteSize ( ) = getTypeSize ( unspecifiedType ) and
157
157
opaqueType .getTag ( ) = unspecifiedType
158
158
)
159
159
or
160
- unspecifiedType instanceof BoolType and result .( IRBooleanType ) .getByteSize ( ) = type .getSize ( )
160
+ unspecifiedType instanceof BoolType and
161
+ result .( IRBooleanType ) .getByteSize ( ) = unspecifiedType .getSize ( )
161
162
or
162
163
isSignedIntegerType ( unspecifiedType ) and
163
- result .( IRSignedIntegerType ) .getByteSize ( ) = type .getSize ( )
164
+ result .( IRSignedIntegerType ) .getByteSize ( ) = unspecifiedType .getSize ( )
164
165
or
165
166
isUnsignedIntegerType ( unspecifiedType ) and
166
- result .( IRUnsignedIntegerType ) .getByteSize ( ) = type .getSize ( )
167
+ result .( IRUnsignedIntegerType ) .getByteSize ( ) = unspecifiedType .getSize ( )
167
168
or
168
169
exists ( FloatingPointType floatType , IRFloatingPointType irFloatType |
169
170
floatType = unspecifiedType and
@@ -173,7 +174,8 @@ private IRType getIRTypeForPRValue(Type type) {
173
174
irFloatType .getDomain ( ) = floatType .getDomain ( )
174
175
)
175
176
or
176
- isPointerIshType ( unspecifiedType ) and result .( IRAddressType ) .getByteSize ( ) = getTypeSize ( type )
177
+ isPointerIshType ( unspecifiedType ) and
178
+ result .( IRAddressType ) .getByteSize ( ) = getTypeSize ( unspecifiedType )
177
179
or
178
180
unspecifiedType instanceof FunctionPointerIshType and
179
181
result .( IRFunctionAddressType ) .getByteSize ( ) = getTypeSize ( type )
0 commit comments