aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-02-07 13:39:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-02-07 13:39:54 -0300
commit0c9bec0d38ed3d2c45d7be4e764a0bcffef98be1 (patch)
tree05fd1ba56705dc0a1728e1bedda7961cc96414c1 /lapi.c
parentc31d6774ac7db4cfbc548ce507ae65ab6036f873 (diff)
downloadlua-0c9bec0d38ed3d2c45d7be4e764a0bcffef98be1.tar.gz
lua-0c9bec0d38ed3d2c45d7be4e764a0bcffef98be1.tar.bz2
lua-0c9bec0d38ed3d2c45d7be4e764a0bcffef98be1.zip
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.)
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c2
1 files changed, 1 insertions, 1 deletions
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) {
781} 781}
782 782
783 783
784LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { 784LUA_API void lua_createtable (lua_State *L, unsigned narray, unsigned nrec) {
785 Table *t; 785 Table *t;
786 lua_lock(L); 786 lua_lock(L);
787 t = luaH_new(L); 787 t = luaH_new(L);