lua-users home
lua-l archive

Re: Possible bug in lua_next() ?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2001年12月18日, 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

AltStyle によって変換されたページ (->オリジナル) /