diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-01-21 13:33:59 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-01-21 13:33:59 -0300 |
| commit | 7d7ae8781e64e2b3b212d5c7b7c1b98b694df5ef (patch) | |
| tree | a29433a8a29cd79ec3c8abc308c133e81d4259c6 /ltests.c | |
| parent | 724012d3d07f43f03451bb05d2bd9f55dff1d116 (diff) | |
| download | lua-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 'ltests.c')
| -rw-r--r-- | ltests.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -809,7 +809,7 @@ static int listk (lua_State *L) { | |||
| 809 | luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), | 809 | luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), |
| 810 | 1, "Lua function expected"); | 810 | 1, "Lua function expected"); |
| 811 | p = getproto(obj_at(L, 1)); | 811 | p = getproto(obj_at(L, 1)); |
| 812 | lua_createtable(L, cast_uint(p->sizek), 0); | 812 | lua_createtable(L, p->sizek, 0); |
| 813 | for (i=0; i<p->sizek; i++) { | 813 | for (i=0; i<p->sizek; i++) { |
| 814 | pushobject(L, p->k+i); | 814 | pushobject(L, p->k+i); |
| 815 | lua_rawseti(L, -2, i+1); | 815 | lua_rawseti(L, -2, i+1); |
| @@ -825,7 +825,7 @@ static int listabslineinfo (lua_State *L) { | |||
| 825 | 1, "Lua function expected"); | 825 | 1, "Lua function expected"); |
| 826 | p = getproto(obj_at(L, 1)); | 826 | p = getproto(obj_at(L, 1)); |
| 827 | luaL_argcheck(L, p->abslineinfo != NULL, 1, "function has no debug info"); | 827 | luaL_argcheck(L, p->abslineinfo != NULL, 1, "function has no debug info"); |
| 828 | lua_createtable(L, 2u * cast_uint(p->sizeabslineinfo), 0); | 828 | lua_createtable(L, 2 * p->sizeabslineinfo, 0); |
| 829 | for (i=0; i < p->sizeabslineinfo; i++) { | 829 | for (i=0; i < p->sizeabslineinfo; i++) { |
| 830 | lua_pushinteger(L, p->abslineinfo[i].pc); | 830 | lua_pushinteger(L, p->abslineinfo[i].pc); |
| 831 | lua_rawseti(L, -2, 2 * i + 1); | 831 | lua_rawseti(L, -2, 2 * i + 1); |
| @@ -867,7 +867,7 @@ void lua_printstack (lua_State *L) { | |||
| 867 | 867 | ||
| 868 | 868 | ||
| 869 | static int get_limits (lua_State *L) { | 869 | static int get_limits (lua_State *L) { |
| 870 | lua_createtable(L, 0, 6); | 870 | lua_createtable(L, 0, 5); |
| 871 | setnameval(L, "IS32INT", LUAI_IS32INT); | 871 | setnameval(L, "IS32INT", LUAI_IS32INT); |
| 872 | setnameval(L, "MAXARG_Ax", MAXARG_Ax); | 872 | setnameval(L, "MAXARG_Ax", MAXARG_Ax); |
| 873 | setnameval(L, "MAXARG_Bx", MAXARG_Bx); | 873 | setnameval(L, "MAXARG_Bx", MAXARG_Bx); |
