aboutsummaryrefslogtreecommitdiff
path: root/AST/DeclSerialization.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-16 18:11:10 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-16 18:11:10 +0000
commitda256858f09a17e8a7e04abc88cda7653a62938c (patch)
tree5405c59791599de91cfa674c3d07738bcb991b47 /AST/DeclSerialization.cpp
parentf82228f6ed2b4bb195a519afa777ba521b5c62df (diff)
Fixed bug in the serialization of FunctionDecls. We would incorrectly
query for the number of parameters for FunctionDecls that had type FunctionTypeNoProto. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/DeclSerialization.cpp')
-rw-r--r--AST/DeclSerialization.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/AST/DeclSerialization.cpp b/AST/DeclSerialization.cpp
index 4f80ca1bb4..16654bbe66 100644
--- a/AST/DeclSerialization.cpp
+++ b/AST/DeclSerialization.cpp
@@ -335,14 +335,14 @@ FunctionDecl* FunctionDecl::CreateImpl(Deserializer& D) {
decl->ValueDecl::ReadInRec(D);
D.ReadPtr(decl->DeclChain);
-
- decl->ParamInfo = decl->getNumParams()
- ? new ParmVarDecl*[decl->getNumParams()]
- : NULL;
-
+
Decl* next_declarator;
bool hasParamDecls = D.ReadBool();
+
+ decl->ParamInfo = hasParamDecls
+ ? new ParmVarDecl*[decl->getNumParams()]
+ : NULL;
if (hasParamDecls)
D.BatchReadOwnedPtrs(decl->getNumParams(),