Skip to content

Commit 080a82b

Browse files
authored
Ensure we emit strong_release only for scalar values inside emitDestroyOperation (#74965)
1 parent 53496b6 commit 080a82b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/SILOptimizer/Utils/InstOptUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ void swift::emitDestroyOperation(SILBuilder &builder, SILLocation loc,
10081008
return;
10091009
}
10101010

1011-
if (operand->getType().hasReferenceSemantics()) {
1011+
if (operand->getType().isReferenceCounted(builder.getModule())) {
10121012
auto u = builder.emitStrongRelease(loc, operand);
10131013
if (u.isNull())
10141014
return;

test/AutoDiff/compiler_crashers_fixed/issue-62608-conflicting-debug-info.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-sil -O -g %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -sil-verify-all -emit-sil -O -g %s | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

0 commit comments

Comments
 (0)