]> granicus.if.org Git - clang/commitdiff
Fix PCH crash caused by new assertions in llvm::SmallVector. Use
authorTed Kremenek <kremenek@apple.com>
Fri, 22 May 2009 22:34:23 +0000 (22:34 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 22 May 2009 22:34:23 +0000 (22:34 +0000)
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.

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

lib/Frontend/PCHReaderDecl.cpp

index 64c8e6f7c6d18661024dc404f00fb22faffca20e..53dd6df61bf2105e8b00d3f5747478951d9c9f77 100644 (file)
@@ -268,7 +268,7 @@ void PCHDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) {
   ProtoRefs.reserve(NumProtoRefs);
   for (unsigned I = 0; I != NumProtoRefs; ++I)
     ProtoRefs.push_back(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++])));
-  CD->setProtocolList(&ProtoRefs[0], NumProtoRefs, *Reader.getContext());
+  CD->setProtocolList(ProtoRefs.data(), NumProtoRefs, *Reader.getContext());
   CD->setNextClassCategory(cast_or_null<ObjCCategoryDecl>(Reader.GetDecl(Record[Idx++])));
   CD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }