diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-14 23:38:09 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-14 23:38:09 +0000 |
commit | 049b1684bb7d7177a89da36c347bd33b4a1c6ef2 (patch) | |
tree | e554146a0a2f71261b685668511088d039d7442e /AST/DeclSerialization.cpp | |
parent | c12f51a8631b42aa8b01fa0d1220652e95fa8db1 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/DeclSerialization.cpp')
-rw-r--r-- | AST/DeclSerialization.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/AST/DeclSerialization.cpp b/AST/DeclSerialization.cpp index 208e81ca0f..4f80ca1bb4 100644 --- a/AST/DeclSerialization.cpp +++ b/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; } |