From cfb664c308fcfe5bf17d2fe430bcedf1f3707a28 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Mon, 22 Dec 2008 17:51:10 +0000 Subject: [PATCH] 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 --- lib/Sema/Sema.cpp | 4 ++-- 1 file 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(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 -- 2.50.1