lua-users home
lua-l archive

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


> > I'm really scared of saying something is a bug nowadays.
> > So I'll confine myself to asking whether the following behaviour
> > is reproducible on other systems.
> > 
> > $ lua -l lpeg
> > Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> > > =lpeg.version()
> > 0.12
> > > local Cc=lpeg.Cc; return (Cc(nil)*Cc()/1):match""
> > Segmentation fault (core dumped)
> 
> It seems to be a bug (but it only happens with Lua 5.2).

And it seems to happen with an even simpler example:

> print(lpeg.Cc(nil):match"")

The constant 'nil' does not create an 'uvalue' for the pattern, so
when LPeg tries to access it, there is no table there. In Lua 5.1,
all userdata have an 'fenv', so there is no bug.

-- Roberto