]> granicus.if.org Git - clang/commitdiff
Allow the next catoregory slot to be null.
authorSteve Naroff <snaroff@apple.com>
Fri, 24 Apr 2009 16:08:42 +0000 (16:08 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 24 Apr 2009 16:08:42 +0000 (16:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69969 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/PCHReader.cpp

index 06a7258cda6161bae003468e046b0b98caf45e89..d50ab8310b0711adedaece3b22cb21499d07ed0d 100644 (file)
@@ -298,7 +298,9 @@ void PCHDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) {
   for (unsigned I = 0; I != NumProtoRefs; ++I)
     ProtoRefs.push_back(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++])));
   CD->setProtocolList(&ProtoRefs[0], NumProtoRefs, Reader.getContext());
-  CD->setNextClassCategory(cast<ObjCCategoryDecl>(Reader.GetDecl(Record[Idx++])));
+  unsigned nextCat = Record[Idx++];
+  CD->setNextClassCategory(nextCat ? 
+                           cast<ObjCCategoryDecl>(Reader.GetDecl(nextCat)) : 0);
   CD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }