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 /lapi.c | |
| 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 'lapi.c')
| -rw-r--r-- | lapi.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -781,7 +781,7 @@ LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) { | |||
| 781 | } | 781 | } |
| 782 | 782 | ||
| 783 | 783 | ||
| 784 | LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { | 784 | LUA_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); |
