From: Ted Kremenek Date: Mon, 9 Feb 2009 17:10:09 +0000 (+0000) Subject: Deallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=353ffceafc6bcebd5592cb9d93ea3f9242e5370a;p=clang 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 --- 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) {