From f9e35627ed26dff4114a1d01ff113d8b4cc91ab5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 26 Feb 2025 11:31:10 -0300 Subject: '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.) --- ltests.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ltests.h') diff --git a/ltests.h b/ltests.h index df72307a..cc372b8f 100644 --- a/ltests.h +++ b/ltests.h @@ -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 */ -- cgit v1.2.3-55-g6feb