Skip to content

Commit ce24269

Browse files
committed
Bail out of ossa rauw for move only values
1 parent 40d8f34 commit ce24269

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/SILOptimizer/Utils/OwnershipOptUtils.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ bool OwnershipRAUWHelper::hasValidRAUWOwnership(SILValue oldValue,
386386
if (m->getStage() == SILStage::Raw)
387387
return false;
388388

389+
// OSSA rauw can create copies. Bail out if we have move only values.
390+
if (newValue->getType().isMoveOnly()) {
391+
return false;
392+
}
393+
389394
return true;
390395
}
391396

test/Interpreter/moveonly_linkedlist.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %target-run-simple-swift(-Xfrontend -sil-verify-all)
22
// RUN: %target-run-simple-swift(-O -Xfrontend -sil-verify-all)
3+
// RUN: %target-run-simple-swift(-O -Xfrontend -sil-verify-all -Xfrontend -enable-ossa-modules)
34

45
// REQUIRES: executable_test
56

0 commit comments

Comments
 (0)