parent
65e804a9c3
commit
b989c9e65c
|
@ -618,8 +618,10 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E,
|
||||||
// Convert the LHS/RHS values to the computation type.
|
// Convert the LHS/RHS values to the computation type.
|
||||||
OpInfo.LHS = EmitScalarConversion(OpInfo.LHS, LHSTy, ComputeType);
|
OpInfo.LHS = EmitScalarConversion(OpInfo.LHS, LHSTy, ComputeType);
|
||||||
|
|
||||||
// Do not merge types for -= where the LHS is a pointer.
|
// Do not merge types for -= or += where the LHS is a pointer.
|
||||||
if (E->getOpcode() != BinaryOperator::SubAssign ||
|
if (!(E->getOpcode() == BinaryOperator::SubAssign ||
|
||||||
|
E->getOpcode() == BinaryOperator::AddAssign) ||
|
||||||
|
// if (E->getOpcode() != BinaryOperator::SubAssign ||
|
||||||
!E->getLHS()->getType()->isPointerType()) {
|
!E->getLHS()->getType()->isPointerType()) {
|
||||||
OpInfo.RHS = EmitScalarConversion(OpInfo.RHS, RHSTy, ComputeType);
|
OpInfo.RHS = EmitScalarConversion(OpInfo.RHS, RHSTy, ComputeType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,3 +14,7 @@ void test1() {
|
||||||
short x;
|
short x;
|
||||||
void test2(char c) { x += c; }
|
void test2(char c) { x += c; }
|
||||||
|
|
||||||
|
void foo(char *strbuf) {
|
||||||
|
int stufflen = 4;
|
||||||
|
strbuf += stufflen;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue