From 4a00f61276a9a38b0427fbae3dbbd86dfb5a0749 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 23 May 2022 10:38:03 -0300 Subject: 'lua_checkstack' doesn't need to check stack overflow 'luaD_growstack' already checks that. This commit also fixes an internal bug in 'luaD_growstack': a large 'n' could cause an arithmetic overflow when computing 'needed'. --- luaconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index d42d14b7..fcc0018b 100644 --- a/luaconf.h +++ b/luaconf.h @@ -728,7 +728,7 @@ ** CHANGE it if you need a different limit. This limit is arbitrary; ** its only purpose is to stop Lua from consuming unlimited stack ** space (and to reserve some numbers for pseudo-indices). -** (It must fit into max(size_t)/32.) +** (It must fit into max(size_t)/32 and max(int)/2.) */ #if LUAI_IS32INT #define LUAI_MAXSTACK 1000000 -- cgit v1.2.3-55-g6feb