[cfe-commits] r72291 - /cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
Ted Kremenek
kremenek at apple.com
Fri May 22 15:34:23 PDT 2009
Author: kremenek
Date: Fri May 22 17:34:23 2009
New Revision: 72291
URL: http://llvm.org/viewvc/llvm-project?rev=72291&view=rev
Log:
Fix PCH crash caused by new assertions in llvm::SmallVector. Use
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.
Modified:
cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
Modified: cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderDecl.cpp?rev=72291&r1=72290&r2=72291&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderDecl.cpp Fri May 22 17:34:23 2009
@@ -268,7 +268,7 @@
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++]));
}
More information about the cfe-commits
mailing list