diff options
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 423b049124..a8cc404907 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) { - static_cast<Expr*>(E)->Destroy(Context); + if (E) static_cast<Expr*>(E)->Destroy(Context); } void Sema::DeleteStmt(StmtTy *S) { - static_cast<Stmt*>(S)->Destroy(Context); + if (S) static_cast<Stmt*>(S)->Destroy(Context); } /// ActOnEndOfTranslationUnit - This is called at the very end of the |