From: Sebastian Redl Date: Mon, 22 Dec 2008 17:51:10 +0000 (+0000) Subject: Expr and Stmt must be destroyed with Destroy, not delete. Fixes PR/3245. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cfb664c308fcfe5bf17d2fe430bcedf1f3707a28;p=clang 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 --- 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(E); + static_cast(E)->Destroy(Context); } void Sema::DeleteStmt(StmtTy *S) { - delete static_cast(S); + static_cast(S)->Destroy(Context); } /// ActOnEndOfTranslationUnit - This is called at the very end of the