MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaK_storevar

Function luaK_storevar

freebsd/contrib/openzfs/module/lua/lcode.c:556–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554
555
556void 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
583void 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