diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-09 17:10:09 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-09 17:10:09 +0000 |
commit | 353ffceafc6bcebd5592cb9d93ea3f9242e5370a (patch) | |
tree | 71b2912da7c2f78151c23e190621868e1422ecb3 /lib/AST/Expr.cpp | |
parent | fb7413f12636cefa9ebec9abf95804f82c305b11 (diff) |
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
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<char*>(StrData)); + this->~StringLiteral(); + C.Deallocate(this); } bool UnaryOperator::isPostfix(Opcode Op) { |