lua-users home
lua-l archive

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

On Wed, 3 Oct 2007 08:27:53 +0200, "Goran Zoricic"
<> wrote:

>> From: "Steve Heller" <>
>> When running exactly the same test with the same data over and over, I
>> keep getting different results, usually with a message that says
>> "attempt to index field '?' (a nil value)", in different places in my
>> code. If I run under the ldb debugger and inspect the data that is
>> supposedly nil, it actually isn't.
>> I'm using 5.1.2. Has anyone seen this behavior before?
>> Thanks.
>> Steve
>Perhaps it has something to do with this:
>Alen Ladavac <> wrote:
>> I have found the cause of this to be in the comparator function. It
>> _must_ return false for elements that are equal, otherwise the results
>> are just like this: either unsorted array, or array containing nils.
>We had similar issues in one of our scripts a couple of months ago and it 
>turned out that the isue was caused by comparator returning true when the 
>first value was less or equal to the second.

Thanks. This is for table.sort, right? Can this result in different
answers for exactly the same code and data? If so, I'll go through the
code and look for any occurrences of this.