aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-01-21 13:33:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-01-21 13:33:59 -0300
commit7d7ae8781e64e2b3b212d5c7b7c1b98b694df5ef (patch)
treea29433a8a29cd79ec3c8abc308c133e81d4259c6 /lapi.c
parent724012d3d07f43f03451bb05d2bd9f55dff1d116 (diff)
downloadlua-7d7ae8781e64e2b3b212d5c7b7c1b98b694df5ef.tar.gz
lua-7d7ae8781e64e2b3b212d5c7b7c1b98b694df5ef.tar.bz2
lua-7d7ae8781e64e2b3b212d5c7b7c1b98b694df5ef.zip
Parameters for 'lua_createtable' back to int
Tables don't accept sizes larger than int.
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lapi.c b/lapi.c
index cf73324b..47d328ca 100644
--- a/lapi.c
+++ b/lapi.c
@@ -782,14 +782,14 @@ LUA_API int lua_rawgetp (lua_State *L, int idx, const void *p) {
782} 782}
783 783
784 784
785LUA_API void lua_createtable (lua_State *L, unsigned narray, unsigned nrec) { 785LUA_API void lua_createtable (lua_State *L, int narray, int nrec) {
786 Table *t; 786 Table *t;
787 lua_lock(L); 787 lua_lock(L);
788 t = luaH_new(L); 788 t = luaH_new(L);
789 sethvalue2s(L, L->top.p, t); 789 sethvalue2s(L, L->top.p, t);
790 api_incr_top(L); 790 api_incr_top(L);
791 if (narray > 0 || nrec > 0) 791 if (narray > 0 || nrec > 0)
792 luaH_resize(L, t, narray, nrec); 792 luaH_resize(L, t, cast_uint(narray), cast_uint(nrec));
793 luaC_checkGC(L); 793 luaC_checkGC(L);
794 lua_unlock(L); 794 lua_unlock(L);
795} 795}