Skip to content

Commit e603183

Browse files
committed
[SILOptimizer] fix overrelease in KeyPathProjector
Because parentValue is the result of a setter projection, it is uninitalized and should not be destroyed again (see 1feead8)
1 parent 620fba6 commit e603183

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/SILOptimizer/Utils/KeyPathProjector.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,7 @@ class OptionalForceProjector : public ComponentProjector {
430430
break;
431431
}
432432
case AccessType::Set: {
433-
// We can destroy the old value and write the new value in its place.
434-
builder.createDestroyAddr(loc, optAddr);
433+
// Write the new value directly into optAddr.
435434
auto objAddr = builder.createInitEnumDataAddr(loc, optAddr, someDecl, objType);
436435

437436
callback(objAddr);

0 commit comments

Comments
 (0)