lua-users home
lua-l archive

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


John Hind wrote:
 Closure* cl = luaF_newLclosure(L, 0, NULL);

I doubt this is it, but you should definitely pass something other then NULL as the environment.

Firstly, any global variable lookup from inside that function will crash (inside a table key lookup function no less ;),
secondly the GC will crash when it comes to mark this function.

I'd recommend clvalue(L->top-2)->l.env, so that the sub functions global table is unchanged.

If that doesn't fix it, try defining lua_assert. Should catch the error much earlier.

Good luck :)

- Alex