From 9018ca711a4c61a031fcaddcb71492dda0bc221e Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 18 Jan 2009 19:57:27 +0000 Subject: [PATCH] fix deallocation of FunctionDecl::ParamInfo llvm-svn: 62469 --- clang/include/clang/AST/Decl.h | 2 +- clang/lib/AST/Decl.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index c0325bdafbb7..050768fe309b 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/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/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 8ae93110170d..5ec6aff4f573 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/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); }