[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Understanding BinOpr
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 10 May 2017 09:46:26 -0300
> I can't figure out what "enterlevel" function is doing here. I am aware
> that the below has implicit stack. I am also aware that "nCcalls" is the
> number of of nested calls.
It avoids a stack overflow in cases of deep recursion in expressions,
such as this:
s = "x = " .. string.rep("(", 2^20)
Without 'enterlevel', you can get a segmentation fault. With it, you
get a nice error ("too many C levels").