From 353ffceafc6bcebd5592cb9d93ea3f9242e5370a Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 9 Feb 2009 17:10:09 +0000 Subject: [PATCH] Deallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the string data before running StringLiteral's destructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64146 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Expr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index e541bb8a82..27ae2b2266 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -54,8 +54,9 @@ StringLiteral::StringLiteral(ASTContext& C, const char *strData, } void StringLiteral::Destroy(ASTContext &C) { - this->~StringLiteral(); C.Deallocate(const_cast(StrData)); + this->~StringLiteral(); + C.Deallocate(this); } bool UnaryOperator::isPostfix(Opcode Op) {