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