| 589 | |
| 590 | |
| 591 | void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { |
| 592 | switch (var->k) { |
| 593 | case VLOCAL: { |
| 594 | freeexp(fs, ex); |
| 595 | exp2reg(fs, ex, var->u.info); |
| 596 | return; |
| 597 | } |
| 598 | case VUPVAL: { |
| 599 | int e = luaK_exp2anyreg(fs, ex); |
| 600 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.info, 0); |
| 601 | break; |
| 602 | } |
| 603 | case VINDEXED: { |
| 604 | OpCode op = (var->u.ind.vt == VLOCAL) ? OP_SETTABLE : OP_SETTABUP; |
| 605 | int e = luaK_exp2RK(fs, ex); |
| 606 | luaK_codeABC(fs, op, var->u.ind.t, var->u.ind.idx, e); |
| 607 | break; |
| 608 | } |
| 609 | default: { |
| 610 | lua_assert(0); /* invalid var kind to store */ |
| 611 | break; |
| 612 | } |
| 613 | } |
| 614 | freeexp(fs, ex); |
| 615 | } |
| 616 | |
| 617 | |
| 618 | void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { |
no test coverage detected