aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-02-05 15:12:41 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-02-05 15:12:41 +0000
commitdf2d3cf2be8b91e1e21234ff5a3aa4f820e7001a (patch)
treed906479ba11de908898bd3297dce0b975a2aa8b4 /lib/AST/Decl.cpp
parent76ad2e85575722e8a38a2bd4648ab4304d9fcd24 (diff)
Fix the symptom of the regression, by having the CXXConditionDeclExpr not destroy its Decl.
However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index b95ff3e180..04ee44a480 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -212,12 +212,14 @@ VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
}
void VarDecl::Destroy(ASTContext& C) {
+ Expr *Init = getInit();
+ if (Init)
+ Init->Destroy(C);
this->~VarDecl();
C.Deallocate((void *)this);
}
VarDecl::~VarDecl() {
- delete getInit();
}
//===----------------------------------------------------------------------===//