MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaK_setlist

Function luaK_setlist

third-party/lua-5.5.0/src/lcode.c:1892–1905  ·  view source on GitHub ↗

** Emit a SETLIST instruction. ** 'base' is register that keeps table; ** 'nelems' is #table plus those to be stored now; ** 'tostore' is number of values (in registers 'base + 1',...) to add to ** table (or LUA_MULTRET to add up to stack top). */

Source from the content-addressed store, hash-verified

1890** table (or LUA_MULTRET to add up to stack top).
1891*/
1892void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) {
1893 lua_assert(tostore != 0);
1894 if (tostore == LUA_MULTRET)
1895 tostore = 0;
1896 if (nelems <= MAXARG_vC)
1897 luaK_codevABCk(fs, OP_SETLIST, base, tostore, nelems, 0);
1898 else {
1899 int extra = nelems / (MAXARG_vC + 1);
1900 nelems %= (MAXARG_vC + 1);
1901 luaK_codevABCk(fs, OP_SETLIST, base, tostore, nelems, 1);
1902 codeextraarg(fs, extra);
1903 }
1904 fs->freereg = cast_byte(base + 1); /* free registers with list values */
1905}
1906
1907
1908/*

Callers 2

closelistfieldFunction · 0.70
lastlistfieldFunction · 0.70

Calls 2

luaK_codevABCkFunction · 0.85
codeextraargFunction · 0.70

Tested by

no test coverage detected