Skip to content

Commit dc4e466

Browse files
committed
AddressUtils: handle address initialization inside _modify.
We can assume that memory is already initialized at the point of a 'yield'; a yield use does not need to invalidate the single-initialization property for temporary stack allocations.
1 parent 1848ac0 commit dc4e466

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/AddressUtils.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,9 @@ extension AddressInitializationWalker {
341341
}
342342

343343
mutating func yieldedAddressUse(of operand: Operand) -> WalkResult {
344-
// An inout yield is a partial write.
345-
return .abortWalk
344+
// An inout yield is a partial write. Initialization via coroutine is not supported, so we assume a prior
345+
// initialization must dominate the yield.
346+
return .continueWalk
346347
}
347348

348349
mutating func dependentAddressUse(of operand: Operand, into value: Value)

0 commit comments

Comments
 (0)