summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-22 00:42:36 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-22 00:42:36 +0000
commit51017b5432de9d588af76c02b2a66e3c0e7efdea (patch)
tree268e315aa8788b55593c724310da70b211893de4
parent20c91421fed1790934af301849d1407ff94d4e63 (diff)
downloadbcm5719-llvm-51017b5432de9d588af76c02b2a66e3c0e7efdea.tar.gz
bcm5719-llvm-51017b5432de9d588af76c02b2a66e3c0e7efdea.zip
Bug fix: For transfer function for unary "!", compare the subexpression value
against '0' of the same bit-width. llvm-svn: 47465
-rw-r--r--clang/Analysis/GRExprEngine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/Analysis/GRExprEngine.cpp b/clang/Analysis/GRExprEngine.cpp
index 80de395c585..6635b0b6a60 100644
--- a/clang/Analysis/GRExprEngine.cpp
+++ b/clang/Analysis/GRExprEngine.cpp
@@ -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);
}
OpenPOWER on IntegriCloud