Defensively ensure that GetExternalDeclStmt protects itself from nested deserialization

llvm-svn: 297322
This commit is contained in:
David Blaikie 2017-03-08 23:57:08 +00:00
parent d1ba16e762
commit 9fd16f84c6
1 changed files with 3 additions and 0 deletions

View File

@ -6811,6 +6811,9 @@ Stmt *ASTReader::GetExternalDeclStmt(uint64_t Offset) {
// Offset here is a global offset across the entire chain.
RecordLocation Loc = getLocalBitOffset(Offset);
Loc.F->DeclsCursor.JumpToBit(Loc.Offset);
assert(NumCurrentElementsDeserializing == 0 &&
"should not be called while already deserializing");
Deserializing D(this);
return ReadStmtFromStream(*Loc.F);
}