aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-02-18 23:42:00 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-02-18 23:42:00 +0000
commit0656e5b9aa52f2a90fb38517e504b4eebbe53381 (patch)
treeeecc393a829f030a0e1bc6da0c6a4e5bce4c28e1
parent5c722c7020b33da57090422b854072258a50b3f0 (diff)
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
-rw-r--r--include/clang/AST/EvaluatedExprVisitor.h3
1 files changed, 2 insertions, 1 deletions
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);
}
};