]> granicus.if.org Git - clang/commitdiff
fix deallocation of FunctionDecl::ParamInfo
authorNuno Lopes <nunoplopes@sapo.pt>
Sun, 18 Jan 2009 19:57:27 +0000 (19:57 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Sun, 18 Jan 2009 19:57:27 +0000 (19:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62469 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Decl.h
lib/AST/Decl.cpp

index c0325bdafbb71736bf19dd59233e867eb726af83..050768fe309b08750696022f9acbd8ddfc6de0b7 100644 (file)
@@ -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:
index 8ae93110170de4f0661dd43d2b55d724eb37a403..5ec6aff4f573624b84ac4f3a0eb92fdea343b07e 100644 (file)
@@ -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);
 }