@@ -1258,7 +1258,7 @@ bool TupleExtractInst::isTrivialEltOfOneRCIDTuple() const {
1258
1258
// parent tuple has only one non-trivial field.
1259
1259
bool FoundNonTrivialField = false ;
1260
1260
SILType OpTy = getOperand ()->getType ();
1261
- unsigned FieldNo = getFieldNo ();
1261
+ unsigned FieldNo = getFieldIndex ();
1262
1262
1263
1263
// For each element index of the tuple...
1264
1264
for (unsigned i = 0 , e = getNumTupleElts (); i != e; ++i) {
@@ -1300,7 +1300,7 @@ bool TupleExtractInst::isEltOnlyNonTrivialElt() const {
1300
1300
// Ok, we know that the elt we are extracting is non-trivial. Make sure that
1301
1301
// we have no other non-trivial elts.
1302
1302
SILType OpTy = getOperand ()->getType ();
1303
- unsigned FieldNo = getFieldNo ();
1303
+ unsigned FieldNo = getFieldIndex ();
1304
1304
1305
1305
// For each element index of the tuple...
1306
1306
for (unsigned i = 0 , e = getNumTupleElts (); i != e; ++i) {
@@ -1348,7 +1348,7 @@ VarDecl *swift::getIndexedField(NominalTypeDecl *decl, unsigned index) {
1348
1348
if (auto *classDecl = dyn_cast<ClassDecl>(decl)) {
1349
1349
for (auto *superDecl = classDecl->getSuperclassDecl (); superDecl != nullptr ;
1350
1350
superDecl = superDecl->getSuperclassDecl ()) {
1351
- assert (index > superDecl->getStoredProperties ().size ()
1351
+ assert (index >= superDecl->getStoredProperties ().size ()
1352
1352
&& " field index cannot refer to a superclass field" );
1353
1353
index -= superDecl->getStoredProperties ().size ();
1354
1354
}
@@ -1357,7 +1357,7 @@ VarDecl *swift::getIndexedField(NominalTypeDecl *decl, unsigned index) {
1357
1357
}
1358
1358
1359
1359
unsigned FieldIndexCacheBase::cacheFieldIndex () {
1360
- unsigned index = getFieldIndex (getParentDecl (), getField ());
1360
+ unsigned index = :: getFieldIndex (getParentDecl (), getField ());
1361
1361
SILInstruction::Bits.FieldIndexCacheBase .FieldIndex = index;
1362
1362
return index;
1363
1363
}
0 commit comments