summaryrefslogtreecommitdiffstats
path: root/clang/AST/DeclSerialization.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-11-14 23:38:09 +0000
committerTed Kremenek <kremenek@apple.com>2007-11-14 23:38:09 +0000
commitcf7a20a6c4ba0f3bcd9f9174f431820fd332e45f (patch)
tree229cad848a22f62aa16c15e9da5de67be34afda4 /clang/AST/DeclSerialization.cpp
parentc77e5a126c1f3fceeedf263d190450974bbe23f6 (diff)
downloadbcm5719-llvm-cf7a20a6c4ba0f3bcd9f9174f431820fd332e45f.tar.gz
bcm5719-llvm-cf7a20a6c4ba0f3bcd9f9174f431820fd332e45f.zip
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. llvm-svn: 44147
Diffstat (limited to 'clang/AST/DeclSerialization.cpp')
-rw-r--r--clang/AST/DeclSerialization.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/AST/DeclSerialization.cpp b/clang/AST/DeclSerialization.cpp
index 208e81ca0f9..4f80ca1bb4a 100644
--- a/clang/AST/DeclSerialization.cpp
+++ b/clang/AST/DeclSerialization.cpp
@@ -266,7 +266,7 @@ void EnumConstantDecl::EmitImpl(Serializer& S) const {
}
EnumConstantDecl* EnumConstantDecl::CreateImpl(Deserializer& D) {
- llvm::APSInt val(0);
+ llvm::APSInt val(1);
D.Read(val);
EnumConstantDecl* decl =
@@ -279,7 +279,7 @@ EnumConstantDecl* EnumConstantDecl::CreateImpl(Deserializer& D) {
D.BatchReadOwnedPtrs(next_declarator,decl->Init);
- decl->setNextDeclarator(cast<ScopedDecl>(next_declarator));
+ decl->setNextDeclarator(cast_or_null<ScopedDecl>(next_declarator));
return decl;
}
OpenPOWER on IntegriCloud