From 0c9bec0d38ed3d2c45d7be4e764a0bcffef98be1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 7 Feb 2024 13:39:54 -0300 Subject: Better handling of size limit when resizing a table Avoid silent conversions from int to unsigned int when calling 'luaH_resize'; avoid silent conversions from lua_Integer to int in 'table.create'; MAXASIZE corrected for the new implementation of arrays; 'luaH_resize' checks explicitly whether new size respects MAXASIZE. (Even constructors were bypassing that check.) --- lapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index bb76b15a..69b890cd 100644 --- a/lapi.c +++ b/lapi.c @@ -781,7 +781,7 @@ LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) { } -LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { +LUA_API void lua_createtable (lua_State *L, unsigned narray, unsigned nrec) { Table *t; lua_lock(L); t = luaH_new(L); -- cgit v1.2.3-55-g6feb