lua-users home
lua-l archive

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


On Sat, 10 Nov 2001, Peter Shook wrote:

>
> I've noticed a little problem with my common debug idiom of
> foreach(t,print)
> Here is the difference between 4.1 alpha and beta:
>
> [...]

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) */
    }


Thank you for the report.

-- Roberto