[cfe-commits] r41405 - /cfe/trunk/CodeGen/CGExprScalar.cpp

Chris Lattner sabre at nondot.org
Sat Aug 25 14:56:20 PDT 2007


Author: lattner
Date: Sat Aug 25 16:56:20 2007
New Revision: 41405

URL: http://llvm.org/viewvc/llvm-project?rev=41405&view=rev
Log:
The new correct compound assignment operators exposed a bug in codegen.

Modified:
    cfe/trunk/CodeGen/CGExprScalar.cpp

Modified: cfe/trunk/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGExprScalar.cpp?rev=41405&r1=41404&r2=41405&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/CodeGen/CGExprScalar.cpp Sat Aug 25 16:56:20 2007
@@ -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();
   }





More information about the cfe-commits mailing list