Skip to content

Commit 08cd370

Browse files
committed
Add mark_dependence to represent lifetime dependence in array allocation
1 parent 3c244c3 commit 08cd370

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6224,7 +6224,10 @@ SILGenFunction::emitUninitializedArrayAllocation(Type ArrayTy,
62246224
SmallVector<ManagedValue, 2> resultElts;
62256225
std::move(result).getAll(resultElts);
62266226

6227-
return {resultElts[0], resultElts[1].getUnmanagedValue()};
6227+
// Add a mark_dependence between the interior pointer and the array value
6228+
auto dependentValue = B.createMarkDependence(Loc, resultElts[1].getValue(),
6229+
resultElts[0].getValue());
6230+
return {resultElts[0], dependentValue};
62286231
}
62296232

62306233
/// Deallocate an uninitialized array.

0 commit comments

Comments
 (0)