[cfe-commits] r58292 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Mon Oct 27 16:02:43 PDT 2008


Author: kremenek
Date: Mon Oct 27 18:02:39 2008
New Revision: 58292

URL: http://llvm.org/viewvc/llvm-project?rev=58292&view=rev
Log:
Remove type-punning warning in GRExprEngine.  No functionality change.

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=58292&r1=58291&r2=58292&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Mon Oct 27 18:02:39 2008
@@ -2178,10 +2178,13 @@
     
       assert (B->isCompoundAssignmentOp());
 
-      if (Op >= BinaryOperator::AndAssign)
-        ((int&) Op) -= (BinaryOperator::AndAssign - BinaryOperator::And);
-      else
-        ((int&) Op) -= BinaryOperator::MulAssign;  
+      if (Op >= BinaryOperator::AndAssign) {
+        Op = (BinaryOperator::Opcode) (Op - (BinaryOperator::AndAssign - 
+                                             BinaryOperator::And));
+      }
+      else {
+        Op = (BinaryOperator::Opcode) (Op - BinaryOperator::MulAssign);
+      }
           
       // Perform a load (the LHS).  This performs the checks for
       // null dereferences, and so on.





More information about the cfe-commits mailing list