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
This commit is contained in:
Chandler Carruth 2011-02-18 23:42:00 +00:00
Родитель 5c722c7020
Коммит 0656e5b9aa
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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);
}
};