From 54d399ac5d029889771fdac90693e640b3a03665 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 27 Oct 2008 23:02:39 +0000 Subject: [PATCH] Remove type-punning warning in GRExprEngine. No functionality change. llvm-svn: 58292 --- clang/lib/Analysis/GRExprEngine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 67dd79a193e4..e843f5d9e17a 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -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.