lua-users home
lua-l archive

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


> Here's what appears to be an inconsistency in the Lua sources.

Not really an inconsistency, I think. Perhaps the code is not as defensive
as you wish. If you change LUA_SIGNATURE or the things that go into the
header, you must set LUAC_HEADERSIZE accordingly.

A simple (untested) fix, which won't catch all abuse is to modify luaU_header
as follows:

void luaU_header (char* h)
{
 int x=1;
 char *H=h;					<<<< new
 ...
 lua_assert((h-H)==LUAC_HEADERSIZE);		<<<< new
}

--lhf