diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2011-02-18 23:42:00 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2011-02-18 23:42:00 +0000 |
| commit | 241b31378da3114e344aaffafe865825479906ac (patch) | |
| tree | ce7e450ccec8c9b2310ae40500361042aa6a8c77 /clang | |
| parent | ce4e629fdfe9ca9d9f55ba47189417eb2723c7a0 (diff) | |
| download | bcm5719-llvm-241b31378da3114e344aaffafe865825479906ac.tar.gz bcm5719-llvm-241b31378da3114e344aaffafe865825479906ac.zip | |
Check for NULL child expressions before visiting them, as the first
thing the visit does is dyn_cast<>, which leads to a nasty segfault.
llvm-svn: 125993
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/EvaluatedExprVisitor.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/include/clang/AST/EvaluatedExprVisitor.h b/clang/include/clang/AST/EvaluatedExprVisitor.h index 5616d8822e5..035f57c12ea 100644 --- a/clang/include/clang/AST/EvaluatedExprVisitor.h +++ b/clang/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); } }; |

