[cfe-commits] r44191 - /cfe/trunk/AST/DeclSerialization.cpp

Ted Kremenek kremenek at apple.com
Fri Nov 16 10:11:12 PST 2007


Author: kremenek
Date: Fri Nov 16 12:11:10 2007
New Revision: 44191

URL: http://llvm.org/viewvc/llvm-project?rev=44191&view=rev
Log:
Fixed bug in the serialization of FunctionDecls.  We would incorrectly
query for the number of parameters for FunctionDecls that had type
FunctionTypeNoProto.

Modified:
    cfe/trunk/AST/DeclSerialization.cpp

Modified: cfe/trunk/AST/DeclSerialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/DeclSerialization.cpp?rev=44191&r1=44190&r2=44191&view=diff

==============================================================================
--- cfe/trunk/AST/DeclSerialization.cpp (original)
+++ cfe/trunk/AST/DeclSerialization.cpp Fri Nov 16 12:11:10 2007
@@ -335,14 +335,14 @@
   
   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(),





More information about the cfe-commits mailing list