From 08804d8fa26d34851ec641466e4b0b51f9b31192 Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Wed, 15 Oct 2025 19:25:02 +0200 Subject: [PATCH] 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 --- .../FunctionSignatureTransforms/ExistentialTransform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp b/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp index bd24ee9687a94..6701c2412243c 100644 --- a/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp +++ b/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp @@ -443,7 +443,7 @@ void ExistentialTransform::populateThunkBody() { switch (ExistentialRepr) { case ExistentialRepresentation::Opaque: { archetypeValue = Builder.createOpenExistentialAddr( - Loc, OrigOperand, OpenedSILType, it->second.AccessType); + Loc, OrigOperand, OpenedSILType.getAddressType(), it->second.AccessType); SILValue calleeArg = archetypeValue; if (OriginallyConsumed) { // open_existential_addr projects a borrowed address into the