lua-users home
lua-l archive

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


2016-01-05 19:18 GMT+02:00 Lorenzo Donati <lorenzodonatibz@tiscali.it>:
>
>
> On 01/01/2016 15:30, Roberto Ierusalimschy wrote:
>>>>
>>>> ```
>>>> local mt = {}
>>>> mt.__newindex = mt
>>>> local t = setmetatable({}, mt)
>>>> t[1] = 1
>> The bug is quite subtle. Follows a fix:

> Although it is subtle, it seems easy to trigger in Lua code.

Do you have an example that does not involve making
__newindex be the metatable itself?