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

Function luaK_setlist

third-party/lua-5.4.6/src/lcode.c:1811–1824  ·  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

1809** table (or LUA_MULTRET to add up to stack top).
1810*/
1811void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) {
1812 lua_assert(tostore != 0 && tostore <= LFIELDS_PER_FLUSH);
1813 if (tostore == LUA_MULTRET)
1814 tostore = 0;
1815 if (nelems <= MAXARG_C)
1816 luaK_codeABC(fs, OP_SETLIST, base, tostore, nelems);
1817 else {
1818 int extra = nelems / (MAXARG_C + 1);
1819 nelems %= (MAXARG_C + 1);
1820 luaK_codeABCk(fs, OP_SETLIST, base, tostore, nelems, 1);
1821 codeextraarg(fs, extra);
1822 }
1823 fs->freereg = base + 1; /* free registers with list values */
1824}
1825
1826
1827/*

Callers 2

closelistfieldFunction · 0.70
lastlistfieldFunction · 0.70

Calls 3

luaK_codeABCkFunction · 0.70
codeextraargFunction · 0.70
luaK_codeABCFunction · 0.50

Tested by

no test coverage detected