diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-09 07:46:54 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-09 07:46:54 +0000 |
commit | 621fc4b47f11585120e3d2eed32d1f46e2063c62 (patch) | |
tree | 993c96be7917671dc44194993c99ef73ef7d5d4e /lib/Serialization | |
parent | 44d2dbdce49d1fca3826d543ba875bb82f759091 (diff) |
[PCH] Add some comments, per Ted's request.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index e2f4ae3a9b..883edba5e3 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -344,6 +344,8 @@ void ASTDeclReader::VisitDecl(Decl *D) { } else { DeclContext *SemaDC = ReadDeclAs<DeclContext>(Record, Idx); DeclContext *LexicalDC = ReadDeclAs<DeclContext>(Record, Idx); + // Avoid calling setLexicalDeclContext() directly because it uses + // Decl::getASTContext() internally which is unsafe during derialization. D->setDeclContextsImpl(SemaDC, LexicalDC, Reader.getContext()); } D->setLocation(Reader.ReadSourceLocation(F, RawLocation)); @@ -351,6 +353,8 @@ void ASTDeclReader::VisitDecl(Decl *D) { if (Record[Idx++]) { // hasAttrs AttrVec Attrs; Reader.ReadAttributes(F, Attrs, Record, Idx); + // Avoid calling setAttrs() directly because it uses Decl::getASTContext() + // internally which is unsafe during derialization. D->setAttrsImpl(Attrs, Reader.getContext()); } D->setImplicit(Record[Idx++]); |