[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT2 bug: 'mytable[mystring] or 0' wrongly 0
- From: Duncan Cross <duncan.cross@...>
- Date: Mon, 16 Nov 2009 19:06:48 +0000
On Mon, Nov 16, 2009 at 6:27 PM, Mike Pall <email@example.com> wrote:
> Duncan Cross wrote:
>> What happens for me is
>> the final assertion fails, and reading back the pairs of values, in a lot of
>> cases towards the end, the first number is not zero or nil but the second
>> value *is* zero (which shouldn't be possible):
> Thank you for the report and the test case! It's a bug in the
> bytecode generation for some conditionals, which shows only in
> compiled code. Patch attached.
Great! Now all the tests run perfectly. (And, of course, quickly.)
> BTW: You'll get better performance if you don't fill the rd
> array backwards. It degrades into a hash table in this case.
> You could just do a quick forward fill before the loop:
> for j=start,finish do rd[j] = 0 end
Ah, yeah, good point. Thanks!