lua-users home
lua-l archive

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


2008/10/19 Florian Weimer <fw@deneb.enyo.de>:
> Is it possible to check if two table have the same metatable, or if a
> table has a specific table as its metatable, besides using
> debug.metatable?  This should work even if __metatable has been
> overridden, and I think it would be fairly safe.

It's not possible in pure Lua, that's the whole point of __metatable
metamethod to lock the object from potentially malicious Lua code. It
is easy to bypass in C.