[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Module system curiosity
- From: Graham Wakefield <wakefield@...>
- Date: Fri, 11 Jun 2010 07:26:42 -0700
On Jun 9, 2010, at 5:25 PM, Jim Jennings wrote:
> On Mon, 7 Jun 2010 01:09:06 +0100, Matthew Wild <firstname.lastname@example.org> 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()