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.

llvm-svn: 63868
This commit is contained in:
Sebastian Redl 2009-02-05 15:12:41 +00:00
parent 726a0d9524
commit 0fb63471de
2 changed files with 6 additions and 2 deletions

View File

@ -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();
}
//===----------------------------------------------------------------------===//

View File

@ -17,7 +17,9 @@
using namespace clang;
void CXXConditionDeclExpr::Destroy(ASTContext& C) {
getVarDecl()->Destroy(C);
// FIXME: Cannot destroy the decl here, because it is linked into the
// DeclContext's chain.
//getVarDecl()->Destroy(C);
delete this;
}