[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Checking for the same metatable
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Mon, 20 Oct 2008 17:28:37 +0200
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.