GRExprEngine::ProcessBranch: Don't register a "pretty-stack printer" when the Condition is null.

llvm-svn: 66636
This commit is contained in:
Ted Kremenek 2009-03-11 03:54:24 +00:00
parent 6e76e592a3
commit 32c41ec66e
1 changed files with 6 additions and 7 deletions

View File

@ -543,10 +543,6 @@ const GRState* GRExprEngine::MarkBranch(const GRState* state,
void GRExprEngine::ProcessBranch(Stmt* Condition, Stmt* Term,
BranchNodeBuilder& builder) {
PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
Condition->getLocStart(),
"Error evaluating branch");
// Remove old bindings for subexpressions.
const GRState* PrevState =
StateMgr.RemoveSubExprBindings(builder.getState());
@ -557,6 +553,10 @@ void GRExprEngine::ProcessBranch(Stmt* Condition, Stmt* Term,
return;
}
PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
Condition->getLocStart(),
"Error evaluating branch");
SVal V = GetSVal(PrevState, Condition);
switch (V.getBaseKind()) {
@ -2380,11 +2380,10 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
continue;
}
// Handle all other values.
// Handle all other values.
BinaryOperator::Opcode Op = U->isIncrementOp() ? BinaryOperator::Add
: BinaryOperator::Sub;
SVal Result = EvalBinOp(Op, V2, MakeConstantVal(1U, U));
state = BindExpr(state, U, U->isPostfix() ? V2 : Result);