Re: Random crashes with ABC enabled

  • From: Maik Nijhuis <manyac@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 27 Mar 2014 08:22:39 +0100

2014-03-26 22:14 GMT+01:00 Denis Golovan <denis.golovan@xxxxxxxxx>:

>
> for i=0,#arr do
>   if arr[i] then -- native boolean array access
>     ...
>   end
> end
>
> It looks like "arr" (which is just a wrapper for a pointer to a native
> array first element) points nowhere or "i" index goes into a large
> negative value.
>
> When accessing native arrays, #arr - 1 is the latest valid index, so your
for loop should look like

for i=0,#arr-1 do ... end

Maik

Other related posts: