Skip to content

Commit 1dc03fe

Browse files
committed
Add early exit for Escapable and copyable types from mayHaveMutableSpan
1 parent 5e88f38 commit 1dc03fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ let lifetimeDependenceScopeFixupPass = FunctionPass(
142142

143143
private extension Type {
144144
func mayHaveMutableSpan(in function: Function, _ context: FunctionPassContext) -> Bool {
145+
// Escapable and Copyable types cannot have MutableSpan
146+
if isEscapable || !isMoveOnly {
147+
return false
148+
}
145149
if hasArchetype {
146150
return true
147151
}

0 commit comments

Comments
 (0)