summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-10-23 01:28:53 +0000
committerJohn McCall <rjmccall@apple.com>2009-10-23 01:28:53 +0000
commite634700c816682c901ccedd8050dbde5ea0696f8 (patch)
tree8c1e3fc8607f7b460af206dfa7b7b50726141607
parent2981d1b93d45ae0664970b845fd90c9c3e951315 (diff)
downloadbcm5719-llvm-e634700c816682c901ccedd8050dbde5ea0696f8.tar.gz
bcm5719-llvm-e634700c816682c901ccedd8050dbde5ea0696f8.zip
FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any. llvm-svn: 84920
-rw-r--r--clang/lib/Frontend/PCHReader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 7dc60f8e994..e804bfc90eb 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -2065,7 +2065,7 @@ void TypeLocReader::VisitFunctionTypeLoc(FunctionTypeLoc TL) {
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) {
OpenPOWER on IntegriCloud