mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix SILCombine of inject_enum_addr of ~Copyable values
Fixes rdar://138798467
This commit is contained in:
@@ -1132,6 +1132,8 @@ SILCombiner::visitInjectEnumAddrInst(InjectEnumAddrInst *IEAI) {
|
||||
IEAI->getOperand()->getType().getObjectType());
|
||||
auto storeQual = !func->hasOwnership()
|
||||
? StoreOwnershipQualifier::Unqualified
|
||||
: IEAI->getOperand()->getType().isMoveOnly()
|
||||
? StoreOwnershipQualifier::Init
|
||||
: StoreOwnershipQualifier::Trivial;
|
||||
Builder.createStore(IEAI->getLoc(), E, IEAI->getOperand(), storeQual);
|
||||
return eraseInstFromFunction(*IEAI);
|
||||
|
||||
Reference in New Issue
Block a user