From: Chandler Carruth Date: Fri, 18 Feb 2011 23:42:00 +0000 (+0000) Subject: Check for NULL child expressions before visiting them, as the first X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0656e5b9aa52f2a90fb38517e504b4eebbe53381;p=clang 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 --- 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); } };