mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Fix another cursor-clobbering mistake.
When reading trailing records, make sure we don't go off and read something else in the mean time... Swift SVN r6518
This commit is contained in:
@@ -1700,11 +1700,17 @@ Type ModuleFile::getType(TypeID TID) {
|
||||
decls_block::BoundGenericTypeLayout::readRecord(scratch, declID, parentID,
|
||||
rawArgumentIDs);
|
||||
SmallVector<Type, 8> genericArgs;
|
||||
for (TypeID type : rawArgumentIDs)
|
||||
genericArgs.push_back(getType(type));
|
||||
NominalTypeDecl *nominal;
|
||||
Type parentTy;
|
||||
{
|
||||
BCOffsetRAII restoreOffset(DeclTypeCursor);
|
||||
for (TypeID type : rawArgumentIDs)
|
||||
genericArgs.push_back(getType(type));
|
||||
nominal = cast<NominalTypeDecl>(getDecl(declID));
|
||||
parentTy = getType(parentID);
|
||||
}
|
||||
|
||||
auto boundTy = BoundGenericType::get(cast<NominalTypeDecl>(getDecl(declID)),
|
||||
getType(parentID), genericArgs);
|
||||
auto boundTy = BoundGenericType::get(nominal, parentTy, genericArgs);
|
||||
typeOrOffset = boundTy;
|
||||
|
||||
// BoundGenericTypes get uniqued in the ASTContext, so it's possible this
|
||||
|
||||
Reference in New Issue
Block a user