lua-users home
lua-l archive

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

On Tue, Jul 08, 2014 at 02:20:15PM -0300, Jo?o Batista de Souza Neto wrote:
> In some negative test cases created for the Lua API, the test requires a
> Stack which is full (or that is not possible to push a new element to it).
> I understand that the Stack is "full" when I call lua_checkstack and it
> returns false, that means I cannot push a new element because we don't
> have free stack slots in the stack. I tried to force this situation by
> calling lua_settop with big numbers or calling lua_pushnil several times,
> but neither worked.
> I want to know if anyone knows how I can force this situation, forcing
> lua_checkstack returns false. I need this to validate my model and to see
> what is the behavior of the API when I try to push a new element when the
> stack is "full".

I looks like the maximum stack is LUAI_MAXSTACK (defined in luaconf.h), plus
some extra slots. See luaD_reallocstack in ldo.c.