Skip to content

Commit f6124c3

Browse files
authored
Merge pull request #82679 from eeckstein/fix-mowte
MoveOnlyWrappedTypeEliminator: handle `end_cow_mutation_addr` instruction
2 parents 87b0ca4 + 50b50af commit f6124c3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/SILOptimizer/Mandatory/MoveOnlyWrappedTypeEliminator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ struct SILMoveOnlyWrappedTypeEliminatorVisitor
234234
NO_UPDATE_NEEDED(BridgeObjectToRef)
235235
NO_UPDATE_NEEDED(BeginAccess)
236236
NO_UPDATE_NEEDED(EndAccess)
237+
NO_UPDATE_NEEDED(EndCOWMutationAddr)
237238
NO_UPDATE_NEEDED(ClassMethod)
238239
NO_UPDATE_NEEDED(FixLifetime)
239240
NO_UPDATE_NEEDED(AddressToPointer)

test/SILOptimizer/span.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-swift-frontend %s -parse-as-library -disable-availability-checking -emit-ir -o /dev/null
2+
3+
// Check that the MoveOnlyWrappedTypeEliminator doesn't crash
4+
func consumingArray(_ arr: consuming [Int]) {
5+
let s = arr.mutableSpan;
6+
_ = consume s
7+
}
8+

0 commit comments

Comments
 (0)