The new correct compound assignment operators exposed a bug in codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41405 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprScalar.cpp b/CodeGen/CGExprScalar.cpp
index c10e510..889842e 100644
--- a/CodeGen/CGExprScalar.cpp
+++ b/CodeGen/CGExprScalar.cpp
@@ -430,8 +430,8 @@
                                   ComputeType).getVal();
   
   // Do not merge types for -= where the LHS is a pointer.
-  if (E->getOpcode() != BinaryOperator::SubAssign &&
-      E->getLHS()->getType()->isPointerType()) {
+  if (E->getOpcode() != BinaryOperator::SubAssign ||
+      !E->getLHS()->getType()->isPointerType()) {
     OpInfo.RHS = CGF.EmitConversion(RValue::get(OpInfo.RHS), RHSTy,
                                     ComputeType).getVal();
   }