diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-22 17:51:10 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-22 17:51:10 +0000 |
commit | cfb664c308fcfe5bf17d2fe430bcedf1f3707a28 (patch) | |
tree | 63ab516cd9cb960360ef31e63e1ae08f3be88259 /lib/Sema/Sema.cpp | |
parent | 398082e33c6d2e3c22733b1444228ea4b10b353f (diff) |
Expr and Stmt must be destroyed with Destroy, not delete. Fixes PR/3245.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 650b8d7d7d..29575838a9 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -179,10 +179,10 @@ void Sema::ImpCastExprToType(Expr *&Expr, QualType Ty, bool isLvalue) { } void Sema::DeleteExpr(ExprTy *E) { - delete static_cast<Expr*>(E); + static_cast<Expr*>(E)->Destroy(Context); } void Sema::DeleteStmt(StmtTy *S) { - delete static_cast<Stmt*>(S); + static_cast<Stmt*>(S)->Destroy(Context); } /// ActOnEndOfTranslationUnit - This is called at the very end of the |