]> granicus.if.org Git - clang/commitdiff
Bug fix: For transfer function for unary "!", compare the subexpression value
authorTed Kremenek <kremenek@apple.com>
Fri, 22 Feb 2008 00:42:36 +0000 (00:42 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 22 Feb 2008 00:42:36 +0000 (00:42 +0000)
against '0' of the same bit-width.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47465 91177308-0d34-0410-b5e6-96231b3b80d8

Analysis/GRExprEngine.cpp

index 80de395c585dd25e61ade3bfde64df3dabd57ca3..6635b0b6a6069ab64f4940d7dad6ebf1fa3ae093 100644 (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);
         }