]> granicus.if.org Git - clang/commitdiff
Allow '__extension__' to be analyzed in a lvalue context.
authorTed Kremenek <kremenek@apple.com>
Sat, 26 Jun 2010 22:40:52 +0000 (22:40 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 26 Jun 2010 22:40:52 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106964 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/GRExprEngine.cpp

index 0519c0f79c7c7adb211573c1f30fb44c28054477..c4bf9696efa75773963397bf783de6dc4480b254 100644 (file)
@@ -2830,7 +2830,7 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, ExplodedNode* Pred,
       return;
     }
       
-    case UnaryOperator::Plus: assert (!asLValue);  // FALL-THROUGH.
+    case UnaryOperator::Plus: assert(!asLValue);  // FALL-THROUGH.
     case UnaryOperator::Extension: {
 
       // Unary "+" is a no-op, similar to a parentheses.  We still have places
@@ -2840,7 +2840,11 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, ExplodedNode* Pred,
 
       Expr* Ex = U->getSubExpr()->IgnoreParens();
       ExplodedNodeSet Tmp;
-      Visit(Ex, Pred, Tmp);
+
+      if (asLValue)
+       VisitLValue(Ex, Pred, Tmp);
+      else
+       Visit(Ex, Pred, Tmp);
 
       for (ExplodedNodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
         const GRState* state = GetState(*I);