From: Nuno Lopes Date: Sun, 18 Jan 2009 19:57:27 +0000 (+0000) Subject: fix deallocation of FunctionDecl::ParamInfo X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=460b0ac80382fa73337d21dd052c1f18b27435d8;p=clang fix deallocation of FunctionDecl::ParamInfo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62469 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index c0325bdafb..050768fe30 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -664,7 +664,7 @@ protected: SClass(S), IsInline(isInline), IsVirtual(false), IsPure(false), TypeSpecStartLoc(TSSL) {} - virtual ~FunctionDecl(); + virtual ~FunctionDecl() {} virtual void Destroy(ASTContext& C); public: diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 8ae9311017..5ec6aff4f5 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -224,17 +224,15 @@ VarDecl::~VarDecl() { // FunctionDecl Implementation //===----------------------------------------------------------------------===// -FunctionDecl::~FunctionDecl() { - delete[] ParamInfo; -} - void FunctionDecl::Destroy(ASTContext& C) { if (Body) Body->Destroy(C); for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I) (*I)->Destroy(C); - + + C.getAllocator().Deallocate(ParamInfo); + Decl::Destroy(C); }