lua-users home
lua-l archive

Re: bug (really: assignment parser stack overflow)

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


Hi,
Anders Bergh wrote:
> On 7/31/07, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> > Mike Pall just reported the following bug:
> >
> > > $ ulimit -s 1024 # Reduce C stack to 1MB for quicker results
> > > $ lua -e 'local s = "a,"; for i=1,18 do s = s..s end print(loadstring("local a"..s.."a=nil", ""))'
> > > Segmentation fault
> > > $
> 
> I can't reproduce the bug, this is what happens here and on my x86_64 machine:
Gee .. a really cute cut'n'paste error which completely changes
the semantics. Umm, Roberto, this needs a space or semicolon at
the end of "local a ". My original mail included the space. :-)
Ok, so here's the same script without wrap-around problems:
 local s = "a,"
 for i=1,18 do s = s..s end
 print(loadstring("local a;"..s.."a=nil", ""))
Bye,
 Mike

AltStyle によって変換されたページ (->オリジナル) /