]> granicus.if.org Git - clang/commitdiff
My previous fix was incorrect for non-chained PCH reuse. Fix again.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 27 Sep 2010 23:20:01 +0000 (23:20 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 27 Sep 2010 23:20:01 +0000 (23:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114922 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTWriter.cpp

index 61ba5ab71ba5a8bf7d0c511a83040347bd7325f3..3f537d21ab574fb5bc3b4ecc9552edc466454aa1 100644 (file)
@@ -1334,7 +1334,7 @@ void ASTWriter::WritePreprocessor(const Preprocessor &PP) {
   // If the preprocessor has a preprocessing record, emit it.
   unsigned NumPreprocessingRecords = 0;
   if (PPRec) {
-    unsigned IndexBase = PPRec->getNumPreallocatedEntities();
+    unsigned IndexBase = Chain ? PPRec->getNumPreallocatedEntities() : 0;
     for (PreprocessingRecord::iterator E = PPRec->begin(Chain),
                                        EEnd = PPRec->end(Chain);
          E != EEnd; ++E) {