From 0656e5b9aa52f2a90fb38517e504b4eebbe53381 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 18 Feb 2011 23:42:00 +0000 Subject: [PATCH] Check for NULL child expressions before visiting them, as the first thing the visit does is dyn_cast<>, which leads to a nasty segfault. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125993 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/EvaluatedExprVisitor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/clang/AST/EvaluatedExprVisitor.h b/include/clang/AST/EvaluatedExprVisitor.h index 5616d8822e..035f57c12e 100644 --- a/include/clang/AST/EvaluatedExprVisitor.h +++ b/include/clang/AST/EvaluatedExprVisitor.h @@ -72,7 +72,8 @@ public: /// expression, assuming they are all potentially evaluated. void VisitStmt(Stmt *S) { for (Stmt::child_range C = S->children(); C; ++C) - this->Visit(*C); + if (*C) + this->Visit(*C); } }; -- 2.40.0