lua-users home
lua-l archive

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


Doug Currie wrote:
> - use lua_replace(L, LUA_ENVIRONINDEX) followed by luaL_register()
> and then, if you are paranoid about leaking your environment, as I am,
> use lua_pushnil(L); lua_replace(L, LUA_ENVIRONINDEX) to hide it

Wrong. The environment must be a valid table. You're storing
random data this way. Turn on assertions for the C API and it'll
complain in lua_replace at api_check(L, ttistable(L->top - 1)).

--Mike