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

llvm-svn: 41405
This commit is contained in:
Chris Lattner
2007-08-25 21:56:20 +00:00
parent 46c72915f4
commit 27f00282e9

View 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();
}