diff options
author | Li Jin <dragon-fly@qq.com> | 2021-11-02 11:17:58 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-11-02 11:17:58 +0800 |
commit | 827c3736f357e09168fc108e8e740c6425d37d9b (patch) | |
tree | 259f977bf7f4ebe0e397fe5e1b74e7fbb1b75e8e /src/3rdParty/lua/ltablib.c | |
parent | aed806476fe50899c0f01750175531ac41267b9d (diff) | |
download | yuescript-827c3736f357e09168fc108e8e740c6425d37d9b.tar.gz yuescript-827c3736f357e09168fc108e8e740c6425d37d9b.tar.bz2 yuescript-827c3736f357e09168fc108e8e740c6425d37d9b.zip |
fix a wrong code generating issue, update builtin Lua.
Diffstat (limited to 'src/3rdParty/lua/ltablib.c')
-rw-r--r-- | src/3rdParty/lua/ltablib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/3rdParty/lua/ltablib.c b/src/3rdParty/lua/ltablib.c index dbfe250..868d78f 100644 --- a/src/3rdParty/lua/ltablib.c +++ b/src/3rdParty/lua/ltablib.c | |||
@@ -59,8 +59,9 @@ static void checktab (lua_State *L, int arg, int what) { | |||
59 | 59 | ||
60 | 60 | ||
61 | static int tinsert (lua_State *L) { | 61 | static int tinsert (lua_State *L) { |
62 | lua_Integer e = aux_getn(L, 1, TAB_RW) + 1; /* first empty element */ | ||
63 | lua_Integer pos; /* where to insert new element */ | 62 | lua_Integer pos; /* where to insert new element */ |
63 | lua_Integer e = aux_getn(L, 1, TAB_RW); | ||
64 | e = luaL_intop(+, e, 1); /* first empty element */ | ||
64 | switch (lua_gettop(L)) { | 65 | switch (lua_gettop(L)) { |
65 | case 2: { /* called with only 2 arguments */ | 66 | case 2: { /* called with only 2 arguments */ |
66 | pos = e; /* insert new element at the end */ | 67 | pos = e; /* insert new element at the end */ |