Skip to content

Commit 1a08342

Browse files
authored
Merge pull request #14650 from gottesmm/pr-3ee39de175e9315f1e1b2f4d4e679aac451c9050
2 parents e81c2b8 + 2410406 commit 1a08342

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/SILGen/SILGenBuiltin.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,8 @@ static ManagedValue emitCastFromReferenceType(SILGenFunction &SGF,
389389
SILValue result = SILUndef::get(destType, SGF.SGM.M);
390390
return ManagedValue::forUnmanaged(result);
391391
}
392-
393-
// Save the cleanup on the argument so we can forward it onto the cast
394-
// result.
395-
auto cleanup = args[0].getCleanup();
396-
397-
// Take the reference type argument and cast it.
398-
SILValue result = SGF.B.createUncheckedRefCast(loc, args[0].getValue(),
399-
destType);
400-
// Return the cast result with the original cleanup.
401-
return ManagedValue(result, cleanup);
392+
393+
return SGF.B.createUncheckedRefCast(loc, args[0], destType);
402394
}
403395

404396
/// Specialized emitter for Builtin.castFromNativeObject.

0 commit comments

Comments
 (0)