### Description
Related discussion: https://forums.swift.org/t/a-closure-can-ca…pture-its-own-variable/80804
When using a variable inside a closure used to initialize the variable that is in a function, the compiler crashes. When building the same code with the Static Linux SDK, an error of `closure captures before it is declared` is shown and the compiler does not crash.
### Reproduction
Apple Swift version 6.1.2 (swift-6.1.2-RELEASE)
Target: arm64-apple-macosx15.0
```swift
import Foundation
func parseDate() {
let item: [String:Any] = [
"date": "Not a date"
]
let a: Date? = (item["date"] as? String).flatMap {
dump(a)
return ISO8601DateFormatter().date(from: $0)
}
print(a?.description ?? "Did not parse date")
}
parseDate()
```
### Stack dump
```text
% swift build
Building for debugging...
error: compile command failed due to signal 6 (use -v to see invocation)
SIL memory lifetime failure in @$s18ClosureCaptureTest9parseDateyyF: memory is not initialized, but should be
memory location: %31 = alloc_stack [lexical] [var_decl] $Optional<Date>, let, name "a" // users: %118, %117, %87, %71, %66
at instruction: copy_addr %31 to [init] %65 : $*Optional<Date> // id: %66
in function:
// parseDate()
// Isolation: unspecified
sil [ossa] @$s18ClosureCaptureTest9parseDateyyF : $@convention(thin) () -> () {
bb0:
%0 = integer_literal $Builtin.Word, 1 // user: %2
// function_ref _allocateUninitializedArray<A>(_:)
%1 = function_ref @$ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %2
%2 = apply %1<(String, Any)>(%0) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %3
(%3, %4) = destructure_tuple %2 : $(Array<(String, Any)>, Builtin.RawPointer) // users: %25, %5, %5
%5 = mark_dependence %4 : $Builtin.RawPointer on %3 : $Array<(String, Any)> // user: %6
%6 = pointer_to_address %5 : $Builtin.RawPointer to [strict] $*(String, Any) // users: %8, %7
%7 = tuple_element_addr %6 : $*(String, Any), 0 // user: %15
%8 = tuple_element_addr %6 : $*(String, Any), 1 // user: %22
%9 = string_literal utf8 "date" // user: %14
%10 = integer_literal $Builtin.Word, 4 // user: %14
%11 = integer_literal $Builtin.Int1, -1 // user: %14
%12 = metatype $@thin String.Type // user: %14
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%13 = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %14
%14 = apply %13(%9, %10, %11, %12) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %15
store %14 to [init] %7 : $*String // id: %15
%16 = string_literal utf8 "Not a date" // user: %21
%17 = integer_literal $Builtin.Word, 10 // user: %21
%18 = integer_literal $Builtin.Int1, -1 // user: %21
%19 = metatype $@thin String.Type // user: %21
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%20 = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %21
%21 = apply %20(%16, %17, %18, %19) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %23
%22 = init_existential_addr %8 : $*Any, $String // user: %23
store %21 to [init] %22 : $*String // id: %23
// function_ref _finalizeUninitializedArray<A>(_:)
%24 = function_ref @$ss27_finalizeUninitializedArrayySayxGABnlF : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0> // user: %25
%25 = apply %24<(String, Any)>(%3) : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0> // user: %28
%26 = metatype $@thin Dictionary<String, Any>.Type // user: %28
// function_ref Dictionary.init(dictionaryLiteral:)
%27 = function_ref @$sSD17dictionaryLiteralSDyxq_Gx_q_td_tcfC : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@owned Array<(τ_0_0, τ_0_1)>, @thin Dictionary<τ_0_0, τ_0_1>.Type) -> @owned Dictionary<τ_0_0, τ_0_1> // user: %28
%28 = apply %27<String, Any>(%25, %26) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@owned Array<(τ_0_0, τ_0_1)>, @thin Dictionary<τ_0_0, τ_0_1>.Type) -> @owned Dictionary<τ_0_0, τ_0_1> // user: %29
%29 = move_value [var_decl] %28 : $Dictionary<String, Any> // users: %119, %33, %30
debug_value %29 : $Dictionary<String, Any>, let, name "item" // id: %30
%31 = alloc_stack [lexical] [var_decl] $Optional<Date>, let, name "a" // users: %118, %117, %87, %71, %66
%32 = alloc_stack $Optional<Any> // users: %59, %47, %128, %127, %46, %43
%33 = begin_borrow %29 : $Dictionary<String, Any> // users: %58, %126, %43
%34 = string_literal utf8 "date" // user: %39
%35 = integer_literal $Builtin.Word, 4 // user: %39
%36 = integer_literal $Builtin.Int1, -1 // user: %39
%37 = metatype $@thin String.Type // user: %39
// function_ref String.init(_builtinStringLiteral:utf8CodeUnitCount:isASCII:)
%38 = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %39
%39 = apply %38(%34, %35, %36, %37) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String // user: %41
%40 = alloc_stack $String // users: %45, %44, %43, %41
store %39 to [init] %40 : $*String // id: %41
// function_ref Dictionary.subscript.getter
%42 = function_ref @$sSDyq_Sgxcig : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in_guaranteed τ_0_0, @guaranteed Dictionary<τ_0_0, τ_0_1>) -> @out Optional<τ_0_1> // user: %43
%43 = apply %42<String, Any>(%32, %40, %33) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in_guaranteed τ_0_0, @guaranteed Dictionary<τ_0_0, τ_0_1>) -> @out Optional<τ_0_1>
destroy_addr %40 : $*String // id: %44
dealloc_stack %40 : $*String // id: %45
switch_enum_addr %32 : $*Optional<Any>, case #Optional.some!enumelt: bb1, case #Optional.none!enumelt: bb11 // id: %46
bb1: // Preds: bb0
%47 = unchecked_take_enum_data_addr %32 : $*Optional<Any>, #Optional.some!enumelt // user: %49
%48 = alloc_stack $String // users: %55, %52, %50, %49
checked_cast_addr_br take_always Any in %47 : $*Any to String in %48 : $*String, bb2, bb3 // id: %49
bb2: // Preds: bb1
%50 = load [take] %48 : $*String // user: %51
%51 = enum $Optional<String>, #Optional.some!enumelt, %50 : $String // user: %53
dealloc_stack %48 : $*String // id: %52
br bb4(%51 : $Optional<String>) // id: %53
bb3: // Preds: bb1
%54 = enum $Optional<String>, #Optional.none!enumelt // user: %56
dealloc_stack %48 : $*String // id: %55
br bb4(%54 : $Optional<String>) // id: %56
// %57 // user: %60
bb4(%57 : @owned $Optional<String>): // Preds: bb3 bb2
end_borrow %33 : $Dictionary<String, Any> // id: %58
dealloc_stack %32 : $*Optional<Any> // id: %59
br bb5(%57 : $Optional<String>) // id: %60
// %61 // user: %63
bb5(%61 : @owned $Optional<String>): // Preds: bb11 bb4
%62 = alloc_stack $Optional<String> // users: %78, %77, %71, %63
store %61 to [init] %62 : $*Optional<String> // id: %63
// function_ref closure #1 in parseDate()
%64 = function_ref @$s18ClosureCaptureTest9parseDateyyF10Foundation0E0VSgSSXEfU_ : $@convention(thin) @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0, @in_guaranteed Optional<Date>) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <String, Never, Date> // user: %67
%65 = alloc_stack $Optional<Date> // users: %76, %67, %66
copy_addr %31 to [init] %65 : $*Optional<Date> // id: %66
%67 = partial_apply [callee_guaranteed] %64(%65) : $@convention(thin) @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0, @in_guaranteed Optional<Date>) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <String, Never, Date> // users: %75, %68
%68 = convert_escape_to_noescape [not_guaranteed] %67 : $@callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <String, Never, Date> to $@noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <String, Never, Date> // users: %74, %71
// function_ref Optional.flatMap<A, B>(_:)
%69 = function_ref @$sSq7flatMapyqd_0_SgABxqd__YKXEqd__YKs5ErrorRd__Ri_d_0_r0_lF : $@convention(method) <τ_0_0><τ_1_0, τ_1_1 where τ_1_0 : Error, τ_1_1 : ~Copyable> (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <τ_0_0, τ_1_0, τ_1_1>, @in_guaranteed Optional<τ_0_0>) -> (@out Optional<τ_1_1>, @error_indirect τ_1_0) // user: %71
%70 = alloc_stack $Never // users: %73, %71
try_apply %69<String, Never, Date>(%31, %70, %68, %62) : $@convention(method) <τ_0_0><τ_1_0, τ_1_1 where τ_1_0 : Error, τ_1_1 : ~Copyable> (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <τ_0_0, τ_1_0, τ_1_1>, @in_guaranteed Optional<τ_0_0>) -> (@out Optional<τ_1_1>, @error_indirect τ_1_0), normal bb6, error bb12 // id: %71
bb6(%72 : $()): // Preds: bb5
dealloc_stack %70 : $*Never // id: %73
destroy_value %68 : $@noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <String, Never, Date> // id: %74
destroy_value %67 : $@callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out Optional<τ_0_2>, @error_indirect τ_0_1) for <String, Never, Date> // id: %75
dealloc_stack %65 : $*Optional<Date> // id: %76
destroy_addr %62 : $*Optional<String> // id: %77
dealloc_stack %62 : $*Optional<String> // id: %78
%79 = integer_literal $Builtin.Word, 1 // user: %81
// function_ref _allocateUninitializedArray<A>(_:)
%80 = function_ref @$ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %81
%81 = apply %80<Any>(%79) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %82
(%82, %83) = destructure_tuple %81 : $(Array<Any>, Builtin.RawPointer) // users: %107, %84, %84
%84 = mark_dependence %83 : $Builtin.RawPointer on %82 : $Array<Any> // user: %85
%85 = pointer_to_address %84 : $Builtin.RawPointer to [strict] $*Any // user: %102
%86 = alloc_stack $Optional<Date> // users: %94, %89, %123, %122, %88, %87
copy_addr %31 to [init] %86 : $*Optional<Date> // id: %87
switch_enum_addr %86 : $*Optional<Date>, case #Optional.some!enumelt: bb7, case #Optional.none!enumelt: bb10 // id: %88
bb7: // Preds: bb6
%89 = unchecked_take_enum_data_addr %86 : $*Optional<Date>, #Optional.some!enumelt // users: %92, %91
// function_ref Date.description.getter
%90 = function_ref @$s10Foundation4DateV11descriptionSSvg : $@convention(method) (@in_guaranteed Date) -> @owned String // user: %91
%91 = apply %90(%89) : $@convention(method) (@in_guaranteed Date) -> @owned String // user: %93
destroy_addr %89 : $*Date // id: %92
%93 = enum $Optional<String>, #Optional.some!enumelt, %91 : $String // user: %95
dealloc_stack %86 : $*Optional<Date> // id: %94
br bb8(%93 : $Optional<String>) // id: %95
// %96 // user: %98
bb8(%96 : @owned $Optional<String>): // Preds: bb10 bb7
%97 = alloc_stack $Optional<String> // users: %105, %103, %98
store %96 to [init] %97 : $*Optional<String> // id: %98
// function_ref implicit closure #1 in parseDate()
%99 = function_ref @$s18ClosureCaptureTest9parseDateyyFSSyKXEfu_ : $@convention(thin) @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <String> // user: %100
%100 = thin_to_thick_function %99 : $@convention(thin) @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <String> to $@noescape @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <String> // user: %103
// function_ref ?? infix<A>(_:_:)
%101 = function_ref @$ss2qqoiyxxSgn_xyKXKtKRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in Optional<τ_0_0>, @guaranteed @noescape @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <τ_0_0>) -> (@out τ_0_0, @error any Error) // user: %103
%102 = init_existential_addr %85 : $*Any, $String // user: %103
try_apply %101<String>(%102, %97, %100) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in Optional<τ_0_0>, @guaranteed @noescape @callee_guaranteed @substituted <τ_0_0> () -> (@out τ_0_0, @error any Error) for <τ_0_0>) -> (@out τ_0_0, @error any Error), normal bb9, error bb13 // id: %103
bb9(%104 : $()): // Preds: bb8
dealloc_stack %97 : $*Optional<String> // id: %105
// function_ref _finalizeUninitializedArray<A>(_:)
%106 = function_ref @$ss27_finalizeUninitializedArrayySayxGABnlF : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0> // user: %107
%107 = apply %106<Any>(%82) : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0> // users: %116, %113
// function_ref default argument 1 of print(_:separator:terminator:)
%108 = function_ref @$ss5print_9separator10terminatoryypd_S2StFfA0_ : $@convention(thin) () -> @owned String // user: %109
%109 = apply %108() : $@convention(thin) () -> @owned String // users: %115, %113
// function_ref default argument 2 of print(_:separator:terminator:)
%110 = function_ref @$ss5print_9separator10terminatoryypd_S2StFfA1_ : $@convention(thin) () -> @owned String // user: %111
%111 = apply %110() : $@convention(thin) () -> @owned String // users: %114, %113
// function_ref print(_:separator:terminator:)
%112 = function_ref @$ss5print_9separator10terminatoryypd_S2StF : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> () // user: %113
%113 = apply %112(%107, %109, %111) : $@convention(thin) (@guaranteed Array<Any>, @guaranteed String, @guaranteed String) -> ()
destroy_value %111 : $String // id: %114
destroy_value %109 : $String // id: %115
destroy_value %107 : $Array<Any> // id: %116
destroy_addr %31 : $*Optional<Date> // id: %117
dealloc_stack %31 : $*Optional<Date> // id: %118
destroy_value %29 : $Dictionary<String, Any> // id: %119
%120 = tuple () // user: %121
return %120 : $() // id: %121
bb10: // Preds: bb6
destroy_addr %86 : $*Optional<Date> // id: %122
dealloc_stack %86 : $*Optional<Date> // id: %123
%124 = enum $Optional<String>, #Optional.none!enumelt // user: %125
br bb8(%124 : $Optional<String>) // id: %125
bb11: // Preds: bb0
end_borrow %33 : $Dictionary<String, Any> // id: %126
destroy_addr %32 : $*Optional<Any> // id: %127
dealloc_stack %32 : $*Optional<Any> // id: %128
%129 = enum $Optional<String>, #Optional.none!enumelt // user: %130
br bb5(%129 : $Optional<String>) // id: %130
bb12: // Preds: bb5
unreachable // id: %131
bb13(%132 : @owned $any Error): // Preds: bb8
unreachable // id: %133
} // end sil function '$s18ClosureCaptureTest9parseDateyyF'
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file "/.../ClosureCaptureTest/Sources/main.swift" -emit-dependencies-path "/.../ClosureCaptureTest/.build/arm64-apple-macosx/debug/ClosureCaptureTest.build/main.d" -emit-reference-dependencies-path "/.../ClosureCaptureTest/.build/arm64-apple-macosx/debug/ClosureCaptureTest.build/main.swiftdeps" -target arm64-apple-macosx10.13 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I "/.../ClosureCaptureTest/.build/arm64-apple-macosx/debug/Modules" -I /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/lib/swift/macosx/testing -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path "/.../ClosureCaptureTest/.build/arm64-apple-macosx/debug/ModuleCache" -swift-version 6 -Onone -D SWIFT_PACKAGE -D DEBUG -entry-point-function-name ClosureCaptureTest_main -empty-abi-descriptor -plugin-path /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/lib/swift/host/plugins/testing -resource-dir /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir "/.../ClosureCaptureTest" -Xcc -isysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -Xcc -fPIC -Xcc -g -module-name ClosureCaptureTest -package-name closurecapturetest -in-process-plugin-server-path /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/.../Library/Developer/Toolchains/swift-6.1.2-RELEASE.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 15.5 -target-sdk-name macosx15.5 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -o "/.../ClosureCaptureTest/.build/arm64-apple-macosx/debug/ClosureCaptureTest.build/main.swift.o" -index-store-path "/.../ClosureCaptureTest/.build/arm64-apple-macosx/debug/index/store" -index-system-modules
1. Apple Swift version 6.1.2 (swift-6.1.2-RELEASE)
2. Compiling with the current language version
3. While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/.../ClosureCaptureTest/Sources/main.swift")
4. While silgen emitFunction SIL function "@$s18ClosureCaptureTest9parseDateyyF".
for 'parseDate()' (at /.../ClosureCaptureTest/Sources/main.swift:3:1)
5. While verifying SIL function "@$s18ClosureCaptureTest9parseDateyyF".
for 'parseDate()' (at /.../ClosureCaptureTest/Sources/main.swift:3:1)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x000000010825f854 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x000000010825df80 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x000000010825fe98 SignalHandler(int) + 292
3 libsystem_platform.dylib 0x0000000195e54624 _sigtramp + 56
4 libsystem_pthread.dylib 0x0000000195e1a88c pthread_kill + 296
5 libsystem_c.dylib 0x0000000195d23c60 abort + 124
6 swift-frontend 0x0000000108347cc4 swift::SILValueOwnershipChecker::gatherUsers(llvm::SmallVectorImpl<swift::Operand*>&, llvm::SmallVectorImpl<swift::Operand*>&, llvm::SmallVectorImpl<swift::Operand*>&) (.cold.9) + 0
7 swift-frontend 0x0000000103dcd754 (anonymous namespace)::MemoryLifetimeVerifier::requireBitsSetForArgument(llvm::SmallBitVector const&, swift::Operand*) + 0
8 swift-frontend 0x0000000103dccf20 (anonymous namespace)::MemoryLifetimeVerifier::require(llvm::SmallBitVector const&, llvm::Twine const&, swift::SILInstruction*, bool) + 1612
9 swift-frontend 0x0000000103dcd118 (anonymous namespace)::MemoryLifetimeVerifier::requireBitsSet(llvm::SmallBitVector const&, swift::SILValue, swift::SILInstruction*) + 240
10 swift-frontend 0x0000000103dcbbfc (anonymous namespace)::MemoryLifetimeVerifier::checkBlock(swift::SILBasicBlock*, llvm::SmallBitVector&) + 1336
11 swift-frontend 0x0000000103dca99c (anonymous namespace)::MemoryLifetimeVerifier::verify() + 3472
12 swift-frontend 0x0000000103dc9b50 swift::SILFunction::verifyMemoryLifetime(swift::CalleeCache*) + 128
13 swift-frontend 0x0000000103dd84c4 (anonymous namespace)::SILVerifier::visitSILFunction(swift::SILFunction*) + 11616
14 swift-frontend 0x0000000103dd2488 swift::SILFunction::verify(swift::CalleeCache*, bool, bool, bool) const + 224
15 swift-frontend 0x0000000103516008 swift::Lowering::SILGenModule::postEmitFunction(swift::SILDeclRef, swift::SILFunction*) + 312
16 swift-frontend 0x0000000103515764 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 6088
17 swift-frontend 0x0000000103516798 swift::Lowering::SILGenModule::emitOrDelayFunction(swift::SILDeclRef) + 268
18 swift-frontend 0x0000000103513f64 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 184
19 swift-frontend 0x0000000103518f0c swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 176
20 swift-frontend 0x0000000103519428 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 632
21 swift-frontend 0x000000010360e234 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)17>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 148
22 swift-frontend 0x000000010351d430 swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()) + 340
23 swift-frontend 0x0000000103519a44 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 104
24 swift-frontend 0x0000000102f707d0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 424
25 swift-frontend 0x0000000102f7c910 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164
26 swift-frontend 0x0000000102f7250c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 716
27 swift-frontend 0x0000000102f71d28 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2228
28 swift-frontend 0x0000000102d556b0 swift::mainEntry(int, char const**) + 3064
29 dyld 0x0000000195a7ab98 start + 6076
```
### Expected behavior
Complier does not crash.
### Environment
Apple Swift version 6.1.2 (swift-6.1.2-RELEASE)
Target: arm64-apple-macosx15.0
### Additional information
Possibly related to https://github.com/swiftlang/swift/issues/80002?