]> granicus.if.org Git - clang/commitdiff
The evaluation of dereference and address-of is identical.
authorZhongxing Xu <xuzhongxing@gmail.com>
Sat, 18 Dec 2010 05:16:43 +0000 (05:16 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Sat, 18 Dec 2010 05:16:43 +0000 (05:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122146 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRExprEngine.cpp

index 6a383e2e4289096d124f191ac3b1afdf6cbd4677..2977835f826a9533ad8d912545c8bbe83a3b5f45 100644 (file)
@@ -2804,6 +2804,7 @@ void GRExprEngine::VisitUnaryOperator(const UnaryOperator* U,
       assert(!U->isLValue());
       // FALL-THROUGH.
     case UO_Deref:
+    case UO_AddrOf:
     case UO_Extension: {
 
       // Unary "+" is a no-op, similar to a parentheses.  We still have places
@@ -2823,20 +2824,6 @@ void GRExprEngine::VisitUnaryOperator(const UnaryOperator* U,
       return;
     }
 
-    case UO_AddrOf: {
-      assert(!U->isLValue());
-      const Expr* Ex = U->getSubExpr()->IgnoreParens();
-      ExplodedNodeSet Tmp;
-      Visit(Ex, Pred, Tmp);
-      for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
-        const GRState* state = GetState(*I);
-        SVal V = state->getSVal(Ex);
-        state = state->BindExpr(U, V);
-        MakeNode(Dst, U, *I, state);
-      }
-      return;
-    }
-
     case UO_LNot:
     case UO_Minus:
     case UO_Not: {