[cfe-commits] r84920 - /cfe/trunk/lib/Frontend/PCHReader.cpp
John McCall
rjmccall at apple.com
Thu Oct 22 18:28:54 PDT 2009
Author: rjmccall
Date: Thu Oct 22 20:28:53 2009
New Revision: 84920
URL: http://llvm.org/viewvc/llvm-project?rev=84920&view=rev
Log:
FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any.
Modified:
cfe/trunk/lib/Frontend/PCHReader.cpp
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=84920&r1=84919&r2=84920&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Thu Oct 22 20:28:53 2009
@@ -2065,7 +2065,7 @@
TL.setLParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
TL.setRParenLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
for (unsigned i = 0, e = TL.getNumArgs(); i != e; ++i) {
- TL.setArg(i, cast<ParmVarDecl>(Reader.GetDecl(Record[Idx++])));
+ TL.setArg(i, cast_or_null<ParmVarDecl>(Reader.GetDecl(Record[Idx++])));
}
}
void TypeLocReader::VisitFunctionProtoTypeLoc(FunctionProtoTypeLoc TL) {
More information about the cfe-commits
mailing list