lua-users home
lua-l archive

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


Am 04.12.2015 um 08:58 schröbte DeathByNukes:
Looking at the implementation of luaL_checkstack, it merely calls
lua_checkstack and immediately calls luaL_error if that returns
false. luaL_error internally pushes 2 values on the stack without checking.

Shouldn't there be a call to lua_checkstack(L,2) somewhere in there so it
can conditionally pop 2 values from the stack before proceeding?


Lua allocates 5 additional stack slots for internal use in Lua API functions. See `EXTRA_STACK` in `lstate.h`.

Philipp