lua-users home
lua-l archive

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



On 12 Jan 2010, at 19:02, Leo Razoumov wrote:
--code inside the chunk:
local mt_saved= getmetatable(_G)

You should make '_G' point to the actual table containing the global variables instead of the proxy table.

Please, note that here one cannot use __metatable trick to disable
access to the metatable. Ability to update __index/__newindex is
needed to setup proxy table for calling the chunk in other
compartments.

The '__metatable' trick does not prevent you from saving a reference for the metatable and use it to change the '__index'/'__newindex' fields.


--
Renato Maia
Computer Scientist
Tecgraf/PUC-Rio
__________________________
http://www.inf.puc-rio.br/~maia/

--
Renato Maia
Computer Scientist
Tecgraf/PUC-Rio
__________________________
http://www.inf.puc-rio.br/~maia/