Bug fix: For transfer function for unary "!", compare the subexpression value

against '0' of the same bit-width.

llvm-svn: 47465
This commit is contained in:
Ted Kremenek 2008-02-22 00:42:36 +00:00
parent 20c91421fe
commit 51017b5432
1 changed files with 2 additions and 1 deletions

View File

@ -747,7 +747,8 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
St = SetRVal(St, U, Result);
}
else {
nonlval::ConcreteInt V(ValMgr.getZeroWithPtrWidth());
Expr* Ex = U->getSubExpr();
nonlval::ConcreteInt V(ValMgr.getValue(0, Ex->getType()));
RVal Result = EvalBinOp(BinaryOperator::EQ, cast<NonLVal>(SubV), V);
St = SetRVal(St, U, Result);
}