mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add some serialization debug guards.
No functionality change. Swift SVN r5746
This commit is contained in:
@@ -222,6 +222,12 @@ Decl *ModuleFile::getDecl(DeclID DID) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
assert(declOrOffset.get<BitOffset>() != 0 &&
|
||||
"this decl is already being deserialized");
|
||||
declOrOffset = BitOffset(0);
|
||||
#endif
|
||||
|
||||
ASTContext &ctx = ModuleContext->Ctx;
|
||||
|
||||
SmallVector<uint64_t, 64> scratch;
|
||||
@@ -548,6 +554,12 @@ Type ModuleFile::getType(TypeID TID) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
assert(typeOrOffset.get<BitOffset>() != 0 &&
|
||||
"this type is already being deserialized");
|
||||
typeOrOffset = BitOffset(0);
|
||||
#endif
|
||||
|
||||
ASTContext &ctx = ModuleContext->Ctx;
|
||||
|
||||
SmallVector<uint64_t, 64> scratch;
|
||||
|
||||
Reference in New Issue
Block a user