aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclSerialization.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-12 17:29:34 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-12 17:29:34 +0000
commit9f3e89ad02cc155c8f7902c81fa5a9cd6fce2b53 (patch)
tree0174caa260fc49c4b7bb8ab6f2e530a14278e65d /lib/AST/DeclSerialization.cpp
parent769c9cfc6e06bd9d8ffe7a4397b939f19b0e4dc3 (diff)
When reading in the DeclCtx during deserialization, register the DeclCtx of the
ScopedDecl with the backpatcher, and *not* a local variable on the stack. The value of DeclCtx gets filled in *later* by the backpatcher. This fixes: http://llvm.org/bugs/show_bug.cgi?id=2308 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50976 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclSerialization.cpp')
-rw-r--r--lib/AST/DeclSerialization.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp
index cbae831308..291649b0d0 100644
--- a/lib/AST/DeclSerialization.cpp
+++ b/lib/AST/DeclSerialization.cpp
@@ -116,9 +116,10 @@ void ScopedDecl::EmitInRec(Serializer& S) const {
void ScopedDecl::ReadInRec(Deserializer& D, ASTContext& C) {
NamedDecl::ReadInRec(D, C);
D.ReadPtr(Next); // From ScopedDecl.
- Decl *TmpD;
- D.ReadPtr(TmpD); // From ScopedDecl.
- DeclCtx = cast_or_null<DeclContext>(TmpD);
+
+ DeclCtx = 0; // Allow back-patching. Observe that we register
+ D.ReadPtr(DeclCtx); // the variable of the *object* for back-patching.
+ // It's actual value will get filled in later.
}
//===------------------------------------------------------------===//