]> granicus.if.org Git - clang/commitdiff
Deallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the...
authorTed Kremenek <kremenek@apple.com>
Mon, 9 Feb 2009 17:10:09 +0000 (17:10 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 9 Feb 2009 17:10:09 +0000 (17:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64146 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp

index e541bb8a825f5d1b8a9ec96b7bc65f3dd4855a55..27ae2b22661cc0af30a995ec0057c57a1d19c737 100644 (file)
@@ -54,8 +54,9 @@ StringLiteral::StringLiteral(ASTContext& C, const char *strData,
 }
 
 void StringLiteral::Destroy(ASTContext &C) {
-  this->~StringLiteral();
   C.Deallocate(const_cast<char*>(StrData));
+  this->~StringLiteral();
+  C.Deallocate(this);
 }
 
 bool UnaryOperator::isPostfix(Opcode Op) {