lua-users home
lua-l archive

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

Please always post the OS and compilation flags (or distribution s.a. LuaBinaries vs. LuaForWindows) when making bug reports.

Your sample does not crash on OS X 10.5.7 / PowerPC:

PowerBook-G4:Sources asko$ lua -v
Lua 5.1.4  Copyright (C) 1994-2008, PUC-Rio

$ lua kkk.lua
table: 0x124800 kirjoitti 27.6.2009 kello 9:22:

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) = _      --> 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:


Mark Feldman