lua-users home
lua-l archive

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


I see, the default stack max size makes it take a very long time
before it runs out of stack space. Once I reduced the maximum stack
size to a lower value I got the stack overflow error.

I still prefer having an error message which indicates that __call
looped too many times.

On Wed, Aug 4, 2021 at 3:07 AM Xmilia Hermit <xmilia.hermit@gmail.com> wrote:
>
>
> > Example:
> > local t={}setmetatable(t,{__call=t})()
> >
> > This causes an infinite loop in the latest Lua version (5.4.3).
>
> I don't get an infinite loop when executing the example code, instead I get:
> ./lua: test.lua:1: stack overflow
> stack traceback:
>          test.lua:1: in main chunk
>          [C]: in ?
> Since every call in the cain will push one value to the stack this
> should happen every time eventually.
>
> Regards,
> Xmilia