lua-users home
lua-l archive

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


On Jun 9, 2010, at 5:25 PM, Jim Jennings wrote:

> On Mon, 7 Jun 2010 01:09:06 +0100, Matthew Wild <mwild1@gmail.com> wrote:
> 
> 
> I don't know the Lua C interface very well, having used it only a
> little.  But if a C function pokes around in its (Lua) environment, it
> will only get as far as the copy of _G in which it was loaded.  For
> instance, there is no metatable pointing to another environment; there
> are no functions in _G whose environments point to some other
> environment.  Are there other ways that a C function in a module can
> escape my jail?

Anything in C that touches LUA_REGISTRYINDEX is global to the lua_State. 

You should be able to track changes to that through debug.getregistry()