lua-users home
lua-l archive

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


On Sat, Jun 27, 2009 at 4:22 PM, <mark@ppl-pilot.com> wrote:
> Hi everyone (first time posting here...),
>
> while experimenting with adding accessor functions to Lua I discovered a
> crash bug in v5.1.4 of the VM:
>
> === begin code===
>    local grandparent = {}
>    grandparent.__newindex = function(s,_,_) print(s) end
>
>    local parent = {}
>    parent.__newindex = parent
>    setmetatable(parent, grandparent)
>
>    local child = setmetatable({}, parent)
>    child.foo = _      --> CRASH!
> === end code ===
>
> I've tracked down the cause of this bug and created a patch to fix it, you
> can find it at the end of my article on accessors:
>
> http://www.ppl-pilot.com/Lua/LuaAccessors.html
>
> Cheers,
>
> Mark Feldman
>
>
>

I can confirm on x86 Linux running Lua 5.1.4