MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaK_storevar

Function luaK_storevar

src/Chain/libraries/glua/lcode.cpp:592–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

assignmentFunction · 0.85
funcstatFunction · 0.85

Calls 5

freeexpFunction · 0.85
exp2regFunction · 0.85
luaK_exp2anyregFunction · 0.85
luaK_codeABCFunction · 0.85
luaK_exp2RKFunction · 0.85

Tested by

no test coverage detected