Skip to content

Commit 76139d0

Browse files
committed
MemoryLifetimeVerifier: disable non-address-lowered indirect args.
Otherwise the verifier will fail on trivial cases like this: sil hidden [ossa] @testassign : $@convention(thin) <T> (@inout T, @in T) -> () { bb0(%0 : $*T, %1 : @owned $T): store %1 to [assign] %0 : $*T %3 = tuple () return %3 : $() } SIL memory lifetime failure in @testassign: memory is initialized at function return but shouldn't memory location: %1 = argument of bb0 : $T
1 parent a77ced8 commit 76139d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/SIL/Verifier/MemoryLifetime.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,13 @@ void MemoryLocations::analyzeLocations(SILFunction *function) {
168168
case SILArgumentConvention::Indirect_In:
169169
case SILArgumentConvention::Indirect_In_Constant:
170170
case SILArgumentConvention::Indirect_In_Guaranteed:
171-
case SILArgumentConvention::Indirect_Inout:
172171
case SILArgumentConvention::Indirect_Out:
172+
// These are not SIL addresses under -enable-sil-opaque-values
173+
if (!function->getConventions().useLoweredAddresses())
174+
break;
175+
176+
LLVM_FALLTHROUGH;
177+
case SILArgumentConvention::Indirect_Inout:
173178
analyzeLocation(funcArg);
174179
break;
175180
default:

0 commit comments

Comments
 (0)