aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-09 17:10:09 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-09 17:10:09 +0000
commit353ffceafc6bcebd5592cb9d93ea3f9242e5370a (patch)
tree71b2912da7c2f78151c23e190621868e1422ecb3 /lib/AST/Expr.cpp
parentfb7413f12636cefa9ebec9abf95804f82c305b11 (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.cpp3
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) {