diff -rdu lua-5.1.3.orig/src/luaconf.h lua-5.1.3/src/luaconf.h --- lua-5.1.3.orig/src/luaconf.h 2008-02-12 16:17:59.000000000 +0000 +++ lua-5.1.3/src/luaconf.h 2008-02-12 16:26:32.000000000 +0000 @@ -447,10 +447,10 @@ @* can use. ** CHANGE it if you need lots of (Lua) stack space for your C ** functions. This limit is arbitrary; its only purpose is to stop C -** functions to consume unlimited stack space. +** functions to consume unlimited stack space. (must be smaller than +** -LUA_REGISTRYINDEX) */ -#define LUAI_MCS_AUX ((int)(INT_MAX / (4*sizeof(LUA_NUMBER)))) -#define LUAI_MAXCSTACK (LUAI_MCS_AUX > SHRT_MAX ? SHRT_MAX : LUAI_MCS_AUX) +#define LUAI_MAXCSTACK 8000