From 3b44b57423a61e4933e7506c78ff098a8638f961 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 25 Aug 2007 21:56:20 +0000 Subject: [PATCH] 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 --- CodeGen/CGExprScalar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); }