'lua_State.nci' must be an integer

Lua can easily overflow an unsigned short counting nested calls.
(The limit to this value is the maximum stack size, LUAI_MAXSTACK,
which is currently 1e6.)
This commit is contained in:
Roberto Ierusalimschy
2025-02-26 11:31:10 -03:00
parent ceac82f78b
commit f9e35627ed
3 changed files with 18 additions and 3 deletions

View File

@@ -152,9 +152,12 @@ LUA_API void *debug_realloc (void *ud, void *block,
*/
/* make stack-overflow tests run faster */
/*
** Reduce maximum stack size to make stack-overflow tests run faster.
** (But value is still large enough to overflow smaller integers.)
*/
#undef LUAI_MAXSTACK
#define LUAI_MAXSTACK 50000
#define LUAI_MAXSTACK 68000
/* test mode uses more stack space */