[cfe-commits] r43365 - in /cfe/trunk: CodeGen/CGExprScalar.cpp test/CodeGen/compound.c

Chris Lattner clattner at apple.com
Tue Oct 30 11:26:30 PDT 2007


On Oct 25, 2007, at 3:19 PM, Devang Patel wrote:

> Author: dpatel
> Date: Thu Oct 25 17:19:13 2007
> New Revision: 43365
>
> URL: http://llvm.org/viewvc/llvm-project?rev=43365&view=rev
> Log:
> Fix  "strbuf += stufflen;" crash.

Cool.

> @@ -618,8 +618,10 @@
>    // Convert the LHS/RHS values to the computation type.
>    OpInfo.LHS = EmitScalarConversion(OpInfo.LHS, LHSTy, ComputeType);
>
> -  // Do not merge types for -= where the LHS is a pointer.
> -  if (E->getOpcode() != BinaryOperator::SubAssign ||
> +  // Do not merge types for -= or += where the LHS is a pointer.
> +  if (!(E->getOpcode() == BinaryOperator::SubAssign ||
> +          E->getOpcode() == BinaryOperator::AddAssign) ||
> +  //  if (E->getOpcode() != BinaryOperator::SubAssign ||
>        !E->getLHS()->getType()->isPointerType()) {
>      OpInfo.RHS = EmitScalarConversion(OpInfo.RHS, RHSTy,  
> ComputeType);

Please remove the commented out line of code and indent the previous  
line more nicely :)

-Chris



More information about the cfe-commits mailing list