]> granicus.if.org Git - clang/commitdiff
Fixed bug in the serialization of FunctionDecls. We would incorrectly
authorTed Kremenek <kremenek@apple.com>
Fri, 16 Nov 2007 18:11:10 +0000 (18:11 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 16 Nov 2007 18:11:10 +0000 (18:11 +0000)
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

AST/DeclSerialization.cpp

index 4f80ca1bb4af103e2818113326358f92706d98c7..16654bbe665584d7548ed5cd29a715b870f910d3 100644 (file)
@@ -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(),