Skip to content

Commit 831b27e

Browse files
committed
[SIL] fix AllocBoxInst's isMoveOnly check
1 parent 84ea52e commit 831b27e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SIL/IR/SILInstructions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,9 @@ AllocBoxInst::AllocBoxInst(SILDebugLocation Loc, CanSILBoxType BoxType,
387387
sharedUInt8().AllocBoxInst.reflection = reflection;
388388

389389
// If we have a noncopyable type, always set uses mvoeable value debug info.
390-
usesMoveableValueDebugInfo |=
391-
BoxType->getLayout()->getFields()[0].getObjectType().isMoveOnly();
390+
auto fieldTy = getSILBoxFieldType(F.getTypeExpansionContext(), BoxType,
391+
F.getModule().Types, 0);
392+
usesMoveableValueDebugInfo |= fieldTy.isMoveOnly();
392393

393394
sharedUInt8().AllocBoxInst.usesMoveableValueDebugInfo =
394395
usesMoveableValueDebugInfo;

0 commit comments

Comments
 (0)