mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: fix Builder.emitDestroy(of:)
Do nothing for values with address types. Fixes a crash in ConstantCapturePropagation rdar://160816390
This commit is contained in:
@@ -767,6 +767,9 @@ extension Builder {
|
||||
if value.type.isTrivial(in: value.parentFunction) {
|
||||
return
|
||||
}
|
||||
if value.type.isAddress {
|
||||
return
|
||||
}
|
||||
if value.parentFunction.hasOwnership {
|
||||
createDestroyValue(operand: value)
|
||||
} else if value.type.isClass {
|
||||
|
||||
Reference in New Issue
Block a user