Skip to content

Commit 07bcac3

Browse files
committed
[semantic-sil] If SIL Ownership is disabled, return Any if a forwarding inst has conflicting ownership.
If SIL Ownership is enabled, we still trigger an unreachable. rdar://29791263
1 parent 87ca878 commit 07bcac3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SIL/SILValue.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,12 @@ ValueOwnershipKindVisitor::visitForwardingInst(SILInstruction *I,
410410

411411
auto MergedValue = Base.merge(OpKind.Value);
412412
if (!MergedValue.hasValue()) {
413+
// If we have mismatched SILOwnership and sil ownership is not enabled,
414+
// just return Any for staging purposes. If SILOwnership is enabled, then
415+
// we must assert!
416+
if (!I->getModule().getOptions().EnableSILOwnership) {
417+
return ValueOwnershipKind::Any;
418+
}
413419
llvm_unreachable("Forwarding inst with mismatching ownership kinds?!");
414420
}
415421
}

0 commit comments

Comments
 (0)