[cfe-commits] r48388 - /cfe/trunk/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Fri Mar 14 20:27:31 PDT 2008
Author: kremenek
Date: Fri Mar 14 22:27:30 2008
New Revision: 48388
URL: http://llvm.org/viewvc/llvm-project?rev=48388&view=rev
Log:
Handle StmtExprs whose last contained statement is not an expression.
Modified:
cfe/trunk/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/GRExprEngine.cpp?rev=48388&r1=48387&r2=48388&view=diff
==============================================================================
--- cfe/trunk/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/Analysis/GRExprEngine.cpp Fri Mar 14 22:27:30 2008
@@ -1421,9 +1421,17 @@
StmtExpr* SE = cast<StmtExpr>(S);
ValueState* St = GetState(Pred);
- Expr* LastExpr = cast<Expr>(*SE->getSubStmt()->body_rbegin());
- Nodify(Dst, SE, Pred, SetRVal(St, SE, GetRVal(St, LastExpr)));
- break;
+
+ // FIXME: Not certain if we can have empty StmtExprs. If so, we should
+ // probably just remove these from the CFG.
+ assert (!SE->getSubStmt()->body_empty());
+
+ if (Expr* LastExpr = dyn_cast<Expr>(*SE->getSubStmt()->body_rbegin()))
+ Nodify(Dst, SE, Pred, SetRVal(St, SE, GetRVal(St, LastExpr)));
+ else
+ Dst.Add(Pred);
+
+ break;
}
// FIXME: We may wish to always bind state to ReturnStmts so
More information about the cfe-commits
mailing list