diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-02-07 13:39:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-02-07 13:39:54 -0300 |
commit | 0c9bec0d38ed3d2c45d7be4e764a0bcffef98be1 (patch) | |
tree | 05fd1ba56705dc0a1728e1bedda7961cc96414c1 /lua.h | |
parent | c31d6774ac7db4cfbc548ce507ae65ab6036f873 (diff) | |
download | lua-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.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -268,7 +268,7 @@ LUA_API int (lua_rawget) (lua_State *L, int idx); | |||
268 | LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n); | 268 | LUA_API int (lua_rawgeti) (lua_State *L, int idx, lua_Integer n); |
269 | LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); | 269 | LUA_API int (lua_rawgetp) (lua_State *L, int idx, const void *p); |
270 | 270 | ||
271 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); | 271 | LUA_API void (lua_createtable) (lua_State *L, unsigned narr, unsigned nrec); |
272 | LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue); | 272 | LUA_API void *(lua_newuserdatauv) (lua_State *L, size_t sz, int nuvalue); |
273 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); | 273 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); |
274 | LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n); | 274 | LUA_API int (lua_getiuservalue) (lua_State *L, int idx, int n); |