[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: modules, require, magic
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 19 Oct 2011 18:51:11 -0200
> 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
- References:
- modules, require, magic, Eduardo Ochs
- Re: modules, require, magic, Javier Guerra Giraldez
- Re: modules, require, magic, Petite Abeille
- Re: modules, require, magic, Sam Roberts
- Re: modules, require, magic, David Manura
- Re: modules, require, magic, Hisham
- Re: modules, require, magic, Roberto Ierusalimschy
- Re: modules, require, magic, Hisham