Add null check in CFGBuilder::VisitStmt() to make CFG construction

more resilient to bad code.

llvm-svn: 102793
This commit is contained in:
Ted Kremenek 2010-04-30 22:25:53 +00:00
parent de4b225093
commit bc1416dcad
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,10 @@ bool CFGBuilder::FinishBlock(CFGBlock* B) {
/// DeclStmts (which may contain nested control-flow).
CFGBlock* CFGBuilder::Visit(Stmt * S, AddStmtChoice asc) {
tryAgain:
if (!S) {
badCFG = true;
return 0;
}
switch (S->getStmtClass()) {
default:
return VisitStmt(S, asc);