]> granicus.if.org Git - clang/commitdiff
[PCH] Fix serialization of an ImportDecl.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 3 Oct 2012 01:58:45 +0000 (01:58 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 3 Oct 2012 01:58:45 +0000 (01:58 +0000)
ImportDecl's module ID was not written out and the reader accepted as module ID
the serialized:
  Record.push_back(!IdentifierLocs.empty());

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165087 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriterDecl.cpp

index 4f2da6bc518bc0ae4451967ee655a588eea57d90..42ea7946e22c1d854aecf3654ad04f1a3ba45a51 100644 (file)
@@ -1246,6 +1246,7 @@ void ASTDeclReader::VisitImportDecl(ImportDecl *D) {
   SourceLocation *StoredLocs = reinterpret_cast<SourceLocation *>(D + 1);
   for (unsigned I = 0, N = Record.back(); I != N; ++I)
     StoredLocs[I] = ReadSourceLocation(Record, Idx);
+  ++Idx; // The number of stored source locations.
 }
 
 void ASTDeclReader::VisitAccessSpecDecl(AccessSpecDecl *D) {
index 0f9bb3824b88c5cadb60c658676e7438b2ac0aca..3540f4f16cbf624b4f333eb29decb778b8be66ee 100644 (file)
@@ -984,6 +984,7 @@ void ASTDeclWriter::VisitCXXConversionDecl(CXXConversionDecl *D) {
 
 void ASTDeclWriter::VisitImportDecl(ImportDecl *D) {
   VisitDecl(D);
+  Record.push_back(Writer.getSubmoduleID(D->getImportedModule()));
   ArrayRef<SourceLocation> IdentifierLocs = D->getIdentifierLocs();
   Record.push_back(!IdentifierLocs.empty());
   if (IdentifierLocs.empty()) {