MCPcopy Create free account
hub / github.com/danomatika/ofxLua / luaK_setlist

Function luaK_setlist

libs/lua/lcode.c:1807–1820  ·  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

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

Callers 2

closelistfieldFunction · 0.85
lastlistfieldFunction · 0.85

Calls 2

luaK_codeABCkFunction · 0.85
codeextraargFunction · 0.85

Tested by

no test coverage detected