[cfe-commits] r102793 - /cfe/trunk/lib/Analysis/CFG.cpp
Ted Kremenek
kremenek at apple.com
Fri Apr 30 15:25:54 PDT 2010
Author: kremenek
Date: Fri Apr 30 17:25:53 2010
New Revision: 102793
URL: http://llvm.org/viewvc/llvm-project?rev=102793&view=rev
Log:
Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code.
Modified:
cfe/trunk/lib/Analysis/CFG.cpp
Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=102793&r1=102792&r2=102793&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Fri Apr 30 17:25:53 2010
@@ -338,6 +338,10 @@
/// 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);
More information about the cfe-commits
mailing list