lua-users home
lua-l archive

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


> To my surprise, this causes a segmentation fault in Lua 5.2 beta
> (confirmed by Fabio). Commenting the "local mod" in simple.lua:1 makes
> the segfault go away but it still doesn't work as I expected (I
> probably don't understand _ENV completely).

The bug has nothing to do with _ENV. The following trivial program
segfaults:

-----------------------------
local a
function t()
  local mod = 1
  a, mod = 1
end

t()
-----------------------------

The parser generates a wrong opcode (refering to 'a' as upvalue 1 instead
of 0), but I did not have time yet to find why.

-- Roberto