aboutsummaryrefslogtreecommitdiff
path: root/lua.h
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 /lua.h
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 'lua.h')
-rw-r--r--lua.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua.h b/lua.h
index 58f31646..b8e0c571 100644
--- a/lua.h
+++ b/lua.h
@@ -268,7 +268,7 @@ LUA_API int (lua_rawget) (lua_State *L, int idx);
268LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n); 268LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n);
269LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); 269LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p);
270 270
271LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); 271LUA_API void (lua_createtable) (lua_State *L, unsigned narr, unsigned nrec);
272LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue); 272LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue);
273LUA_API int (lua_getmetatable) (lua_State *L, int objindex); 273LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
274LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n); 274LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n);