** 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). */
| 1890 | ** table (or LUA_MULTRET to add up to stack top). |
| 1891 | */ |
| 1892 | void 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 | /* |
no test coverage detected