]> granicus.if.org Git - clang/commitdiff
Within the transfer function of UnaryOperatorExpr, handle implicit promotions
authorTed Kremenek <kremenek@apple.com>
Tue, 30 Sep 2008 05:32:44 +0000 (05:32 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 30 Sep 2008 05:32:44 +0000 (05:32 +0000)
from the subexpression type to the expression type.

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

lib/Analysis/GRExprEngine.cpp

index f39b595061680540177bea1cee68ad4478c9d096..a4ba1965bb8811a5afff1944efcf65e3b26b7d2f 100644 (file)
@@ -1682,7 +1682,12 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
       
       for (NodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {        
         const GRState* St = GetState(*I);
+        
+        // Get the value of the subexpression.
         RVal V = GetRVal(St, Ex);
+
+        // Perform promotions.
+        V = EvalCast(V, U->getType()); 
         
         if (V.isUnknownOrUndef()) {
           MakeNode(Dst, U, *I, SetRVal(St, U, V));