Skip to content

Commit 6d1c4b0

Browse files
committed
When looking for a type layout only use type metadata for existential metatypes
1 parent a46346a commit 6d1c4b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2058,7 +2058,13 @@ namespace {
20582058
return emitFromValueWitnessTable(IGF.IGM.Context.TheEmptyTupleType);
20592059
}
20602060
case MetatypeRepresentation::Thick:
2061-
return emitFromTypeMetadata(type);
2061+
if (isa<ExistentialMetatypeType>(type)) {
2062+
return emitFromTypeMetadata(type);
2063+
} else {
2064+
// Thick metatypes look like pointers with spare bits.
2065+
return emitFromValueWitnessTable(
2066+
CanMetatypeType::get(IGF.IGM.Context.TheNativeObjectType));
2067+
}
20622068
case MetatypeRepresentation::ObjC:
20632069
// Thick metatypes look like pointers with spare bits.
20642070
return emitFromValueWitnessTable(

0 commit comments

Comments
 (0)