Re: [PATCH] remove inline iteration variable
- From
- David Rientjes <rientjes@google.com>
- Date
- Aug 16, 2006, 17:14 UTC
- Message-ID
- <Pine.LNX.4.63.0608161011100.20470@chino.corp.google.com>
- In-Reply-To
- <81b0412b0608160027l2ac53c10gd9a75525ca144f1d@mail.gmail.com>
On Wed, 16 Aug 2006, Alex Riesen wrote:
Show 7 quoted lines
> On 8/15/06, David Rientjes <rientjes@google.com> wrote:
> > Remove unnecessary iteration variable in inline.
> > - for (i = 0; i < in; i++) putchar(' ');
> > + for (; in > 0; in--)
>
> while(in--) putchar(' ');
> That goes into an infinite loop if the argument is negative because it emits a cmpl $0, x(%ebp). Should never happen, but there's no reason not to prevent it with a for loop.
David