]> granicus.if.org Git - clang/commitdiff
Expr and Stmt must be destroyed with Destroy, not delete. Fixes PR/3245.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 22 Dec 2008 17:51:10 +0000 (17:51 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Mon, 22 Dec 2008 17:51:10 +0000 (17:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61335 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp

index 650b8d7d7dd8e9df1d689b0ac50e05e340cf4350..29575838a909b4844bf519e90d42e26ac8f59c83 100644 (file)
@@ -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