[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Possible bug in lua_next() ?
- From: Roberto Ierusalimschy <rieru@...>
- Date: Tue, 18 Dec 2001 15:50:50 -0600 (CST)
On Tue, 18 Dec 2001, Pedro Miller Rabinovitch wrote:
> I'm quite stumped with some weird foreach() behavior I met in lua-4.1-work. The following code:
> [...]
This bug was already reported in the list. From message
Pine.SOL.4.33.0111121005220.12041-100000@smartius.cs.uiuc.edu:
>
> This is a silly bug in the implementation of next :-( The correction is
> trivial (I hope):
>
>
> ltable.c:99 (luaH_index)
>
> if (0 <= i && i < t->sizearray) { /* is `key' inside array part? */
> < return i; /* yes; that's the index */
> ---
> > return i-1; /* yes; that's the index (corrected to C) */
> }
-- Roberto