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