[cfe-commits] r125993 - /cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h

Chandler Carruth chandlerc at gmail.com
Fri Feb 18 15:42:00 PST 2011


Author: chandlerc
Date: Fri Feb 18 17:42:00 2011
New Revision: 125993

URL: http://llvm.org/viewvc/llvm-project?rev=125993&view=rev
Log:
Check for NULL child expressions before visiting them, as the first
thing the visit does is dyn_cast<>, which leads to a nasty segfault.

Modified:
    cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h

Modified: cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h?rev=125993&r1=125992&r2=125993&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h (original)
+++ cfe/trunk/include/clang/AST/EvaluatedExprVisitor.h Fri Feb 18 17:42:00 2011
@@ -72,7 +72,8 @@
   /// 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);
   }
 };
 





More information about the cfe-commits mailing list