lua-users home
lua-l archive

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


On Thursday 18 May 2006 8:23 am, Luiz Henrique de Figueiredo wrote:
> > > That's dangerous. If you expose the registry, you can turn a udata from
> > > one type to another. So you could convert a button to a file and then
> > > call close on it, which will probably crash the host app.
> >
> > isn't this already possible with setmetatable() ?
>
> No, try it! From Lua you can only set the metatables of tables, not of
> udata, precisely to avoid crashing the host app from Lua.

great!  and i see getmetatable() does work, making it possible to check the 
type.


-- 
Javier

Attachment: pgp4WMbFDTiXG.pgp
Description: PGP signature