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

against '0' of the same bit-width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47465 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2008-02-22 00:42:36 +00:00
Родитель 5620631a02
Коммит f7ca6968d5
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -747,7 +747,8 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
St = SetRVal(St, U, Result); St = SetRVal(St, U, Result);
} }
else { 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); RVal Result = EvalBinOp(BinaryOperator::EQ, cast<NonLVal>(SubV), V);
St = SetRVal(St, U, Result); St = SetRVal(St, U, Result);
} }