Skip to content

Commit fc80b51

Browse files
committed
SIL: Don't ask for stored properites of resilient classes in SILModule::getFieldIndex()
1 parent da8c77e commit fc80b51

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SIL/IR/SILModule.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,10 @@ unsigned SILModule::getFieldIndex(NominalTypeDecl *decl, VarDecl *field) {
804804
if (auto *classDecl = dyn_cast<ClassDecl>(decl)) {
805805
for (auto *superDecl = classDecl->getSuperclassDecl(); superDecl != nullptr;
806806
superDecl = superDecl->getSuperclassDecl()) {
807-
index += superDecl->getStoredProperties().size();
807+
if (!superDecl->isResilient(getSwiftModule(),
808+
ResilienceExpansion::Maximal)) {
809+
index += superDecl->getStoredProperties().size();
810+
}
808811
}
809812
}
810813
for (VarDecl *property : decl->getStoredProperties()) {

0 commit comments

Comments
 (0)