Skip to content

Commit 08804d8

Browse files
committed
ExistentialTransform: fix a wrong result type of open_existential_addr
It needs to be the address type of the opened type and not the object type. Unfortunately I don't have a test case for this fix. Fixes a compiler crash rdar://162149588
1 parent ccea096 commit 08804d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void ExistentialTransform::populateThunkBody() {
443443
switch (ExistentialRepr) {
444444
case ExistentialRepresentation::Opaque: {
445445
archetypeValue = Builder.createOpenExistentialAddr(
446-
Loc, OrigOperand, OpenedSILType, it->second.AccessType);
446+
Loc, OrigOperand, OpenedSILType.getAddressType(), it->second.AccessType);
447447
SILValue calleeArg = archetypeValue;
448448
if (OriginallyConsumed) {
449449
// open_existential_addr projects a borrowed address into the

0 commit comments

Comments
 (0)