mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[silgen] Go through and fix up places where during bringup of load_borrow I just put in load_borrow without any end_borrow cleanups. Now use real cleanups.
rdar://29791263
This commit is contained in:
@@ -1792,8 +1792,11 @@ emitEnumElementDispatch(ArrayRef<RowToSpecialize> rows,
|
||||
if (elt->isIndirect() || elt->getParentEnum()->isIndirect()) {
|
||||
SILValue boxedValue = SGF.B.createProjectBox(loc, origCMV.getValue(), 0);
|
||||
eltTL = &SGF.getTypeLowering(boxedValue->getType());
|
||||
if (eltTL->isLoadable())
|
||||
boxedValue = SGF.B.createLoadBorrow(loc, boxedValue);
|
||||
if (eltTL->isLoadable()) {
|
||||
ManagedValue newLoadedBoxValue = SGF.B.createLoadBorrow(
|
||||
loc, ManagedValue::forUnmanaged(boxedValue));
|
||||
boxedValue = newLoadedBoxValue.getUnmanagedValue();
|
||||
}
|
||||
|
||||
// The boxed value may be shared, so we always have to copy it.
|
||||
eltCMV = getManagedSubobject(SGF, boxedValue, *eltTL,
|
||||
|
||||
Reference in New Issue
Block a user