r297322 - Defensively ensure that GetExternalDeclStmt protects itself from nested deserialization
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 8 15:57:09 PST 2017
Author: dblaikie
Date: Wed Mar 8 17:57:08 2017
New Revision: 297322
URL: http://llvm.org/viewvc/llvm-project?rev=297322&view=rev
Log:
Defensively ensure that GetExternalDeclStmt protects itself from nested deserialization
Modified:
cfe/trunk/lib/Serialization/ASTReader.cpp
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=297322&r1=297321&r2=297322&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Mar 8 17:57:08 2017
@@ -6811,6 +6811,9 @@ Stmt *ASTReader::GetExternalDeclStmt(uin
// 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);
}
More information about the cfe-commits
mailing list