From 90bc9a12c72faa3546f00ee165dc8acde0b47bfc Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Tue, 11 Nov 2025 15:57:56 +0000 Subject: [PATCH] [SILGen] Add assert to `emitApplyAllocatingInitializer` Make sure we reliably assert in release builds if `getBuiltinInitDecl` passes a null value here. --- lib/SILGen/SILGenApply.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index f07e7db9467c7..553a9a97d6af8 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -6920,6 +6920,7 @@ RValue SILGenFunction::emitApplyAllocatingInitializer(SILLocation loc, PreparedArguments &&args, Type overriddenSelfType, SGFContext C) { + ASSERT(init); ConstructorDecl *ctor = cast(init.getDecl()); // Form the reference to the allocating initializer.