From: Chris Lattner Date: Sat, 25 Aug 2007 21:56:20 +0000 (+0000) Subject: The new correct compound assignment operators exposed a bug in codegen. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b44b57423a61e4933e7506c78ff098a8638f961;p=clang 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 c10e5106d8..889842e1c8 100644 --- a/CodeGen/CGExprScalar.cpp +++ b/CodeGen/CGExprScalar.cpp @@ -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(); }