diff options
author | John McCall <rjmccall@apple.com> | 2009-10-23 01:28:53 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-23 01:28:53 +0000 |
commit | 86acc2a0ea327bce89b024b23ee071708da98d2f (patch) | |
tree | 47bb96ecb29cf02e899a00d0d750772798842144 /lib/Frontend/PCHReader.cpp | |
parent | 07fb6bef6242c0f2ab47f059583edbdef924823e (diff) |
FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 7dc60f8e99..e804bfc90e 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/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) { |