]> granicus.if.org Git - clang/commitdiff
Remove type-punning warning in GRExprEngine. No functionality change.
authorTed Kremenek <kremenek@apple.com>
Mon, 27 Oct 2008 23:02:39 +0000 (23:02 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 27 Oct 2008 23:02:39 +0000 (23:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58292 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngine.cpp

index 67dd79a193e4603e1725f9be791035fb3b8c2b3b..e843f5d9e17a0a502bdedccb7840910d5f1b4dec 100644 (file)
@@ -2178,10 +2178,13 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
     
       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.