forked from OSchip/llvm-project
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:
parent
726a0d9524
commit
0fb63471de
|
@ -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();
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue