[cfe-commits] r61335 - /cfe/trunk/lib/Sema/Sema.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Mon Dec 22 09:51:11 PST 2008


Author: cornedbee
Date: Mon Dec 22 11:51:10 2008
New Revision: 61335

URL: http://llvm.org/viewvc/llvm-project?rev=61335&view=rev
Log:
Expr and Stmt must be destroyed with Destroy, not delete. Fixes PR/3245.

Modified:
    cfe/trunk/lib/Sema/Sema.cpp

Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=61335&r1=61334&r2=61335&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Mon Dec 22 11:51:10 2008
@@ -179,10 +179,10 @@
 }
 
 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





More information about the cfe-commits mailing list