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

Ted Kremenek kremenek at apple.com
Wed Nov 14 15:38:09 PST 2007


Author: kremenek
Date: Wed Nov 14 17:38:09 2007
New Revision: 44147

URL: http://llvm.org/viewvc/llvm-project?rev=44147&view=rev
Log:
Fixed bug in serialization of EnumConstantDecl where we improperly
"default constructed" an APSInt.  Fixed another bug in the same method
where we did not allow the NextDeclarator to be NULL.

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=44147&r1=44146&r2=44147&view=diff

==============================================================================
--- cfe/trunk/AST/DeclSerialization.cpp (original)
+++ cfe/trunk/AST/DeclSerialization.cpp Wed Nov 14 17:38:09 2007
@@ -266,7 +266,7 @@
 }
  
 EnumConstantDecl* EnumConstantDecl::CreateImpl(Deserializer& D) {
-  llvm::APSInt val(0);
+  llvm::APSInt val(1);
   D.Read(val);
   
   EnumConstantDecl* decl = 
@@ -279,7 +279,7 @@
   
   D.BatchReadOwnedPtrs(next_declarator,decl->Init);
   
-  decl->setNextDeclarator(cast<ScopedDecl>(next_declarator));
+  decl->setNextDeclarator(cast_or_null<ScopedDecl>(next_declarator));
 
   return decl;    
 }





More information about the cfe-commits mailing list