forked from OSchip/llvm-project
Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code. llvm-svn: 102793
This commit is contained in:
parent
de4b225093
commit
bc1416dcad
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue