| 554 | |
| 555 | |
| 556 | void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { |
| 557 | switch (var->k) { |
| 558 | case VLOCAL: { |
| 559 | freeexp(fs, ex); |
| 560 | exp2reg(fs, ex, var->u.info); |
| 561 | return; |
| 562 | } |
| 563 | case VUPVAL: { |
| 564 | int e = luaK_exp2anyreg(fs, ex); |
| 565 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.info, 0); |
| 566 | break; |
| 567 | } |
| 568 | case VINDEXED: { |
| 569 | OpCode op = (var->u.ind.vt == VLOCAL) ? OP_SETTABLE : OP_SETTABUP; |
| 570 | int e = luaK_exp2RK(fs, ex); |
| 571 | luaK_codeABC(fs, op, var->u.ind.t, var->u.ind.idx, e); |
| 572 | break; |
| 573 | } |
| 574 | default: { |
| 575 | lua_assert(0); /* invalid var kind to store */ |
| 576 | break; |
| 577 | } |
| 578 | } |
| 579 | freeexp(fs, ex); |
| 580 | } |
| 581 | |
| 582 | |
| 583 | void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { |
no test coverage detected