summaryrefslogtreecommitdiffstats
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
commit92f78f4c042d6ee11e9e4dc1a849f1556ede9b1f (patch)
tree4c90a7308dc5a69f1543d02778a300f45733d0a3
parent02e5933fa34d3f010e732cca1f01f3237456421e (diff)
downloadbcm5719-llvm-92f78f4c042d6ee11e9e4dc1a849f1556ede9b1f.tar.gz
bcm5719-llvm-92f78f4c042d6ee11e9e4dc1a849f1556ede9b1f.zip
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 llvm-svn: 50976
-rw-r--r--clang/lib/AST/DeclSerialization.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclSerialization.cpp b/clang/lib/AST/DeclSerialization.cpp
index cbae8313082..291649b0d06 100644
--- a/clang/lib/AST/DeclSerialization.cpp
+++ b/clang/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.
}
//===------------------------------------------------------------===//
OpenPOWER on IntegriCloud