]> granicus.if.org Git - clang/commitdiff
The new correct compound assignment operators exposed a bug in codegen.
authorChris Lattner <sabre@nondot.org>
Sat, 25 Aug 2007 21:56:20 +0000 (21:56 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 25 Aug 2007 21:56:20 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41405 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGExprScalar.cpp

index c10e5106d84b66969e7692d4b1a87e84ffc84d9a..889842e1c81828cb764f00d03d2a44d4a1d95e68 100644 (file)
@@ -430,8 +430,8 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const BinaryOperator *E,
                                   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();
   }