Skip to content

Commit 7ac0381

Browse files
committed
SIL: Don't ask for stored properties of resilient types in SILType::isEmpty()
1 parent 4a2269b commit 7ac0381

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SIL/IR/SILType.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ bool SILType::isEmpty(const SILFunction &F) const {
162162
// Also, a struct is empty if it either has no fields or if all fields are
163163
// empty.
164164
SILModule &module = F.getModule();
165+
if (structDecl->isResilient(module.getSwiftModule(),
166+
F.getResilienceExpansion())) {
167+
return false;
168+
}
169+
165170
TypeExpansionContext typeEx = F.getTypeExpansionContext();
166171
for (VarDecl *field : structDecl->getStoredProperties()) {
167172
if (!getFieldType(field, module, typeEx).isEmpty(F))

0 commit comments

Comments
 (0)