lua-users home
lua-l archive

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


Tony Finch <dot@dotat.at> wrote:
>
>   /* lay out all the arrays within a userdata object */
>   args = lua_newuserdata(L, total);
>   argv = (void *)(args + args_size);
>   argl = (void *)(args + args_size + argv_size);

Er, sorry, that can screw up the alignment restrictions.
Try this instead:

  args = lua_newuserdata(L, total);
  argv = (void *)args; args += argv_size;
  argl = (void *)args; args += argl_size;

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
South-east Iceland: Cyclonic 4 or 5, increasing 5 to 7 for a time in north.
Moderate or rough. Occasional rain. Moderate or good.