MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaK_storevar

Function luaK_storevar

third-party/lua-5.2.4/src/lcode.c:558–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556
557
558void 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
585void luaK_self (FuncState *fs, expdesc *e, expdesc *key) {

Callers 2

assignmentFunction · 0.70
funcstatFunction · 0.70

Calls 5

freeexpFunction · 0.70
exp2regFunction · 0.70
luaK_exp2anyregFunction · 0.70
luaK_codeABCFunction · 0.70
luaK_exp2RKFunction · 0.70

Tested by

no test coverage detected