Skip to content

Commit 2d70de8

Browse files
committed
[IRGen] Assert on retaining noncopyable.
1 parent f97134c commit 2d70de8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5109,6 +5109,7 @@ void IRGenSILFunction::visitCondBranchInst(swift::CondBranchInst *i) {
51095109
}
51105110

51115111
void IRGenSILFunction::visitRetainValueInst(swift::RetainValueInst *i) {
5112+
assert(!i->getOperand()->getType().isMoveOnly());
51125113
Explosion in = getLoweredExplosion(i->getOperand());
51135114
Explosion out;
51145115
cast<LoadableTypeInfo>(getTypeInfo(i->getOperand()->getType()))
@@ -5119,6 +5120,7 @@ void IRGenSILFunction::visitRetainValueInst(swift::RetainValueInst *i) {
51195120

51205121
void IRGenSILFunction::visitRetainValueAddrInst(swift::RetainValueAddrInst *i) {
51215122
SILValue operandValue = i->getOperand();
5123+
assert(!operandValue->getType().isMoveOnly());
51225124
Address addr = getLoweredAddress(operandValue);
51235125
SILType addrTy = operandValue->getType();
51245126
SILType objectT = addrTy.getObjectType();

0 commit comments

Comments
 (0)