MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaK_storevar

Function luaK_storevar

lua/lcode.c:479–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477
478
479void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {
480 switch (var->k) {
481 case VLOCAL: {
482 freeexp(fs, ex);
483 exp2reg(fs, ex, var->u.s.info);
484 return;
485 }
486 case VUPVAL: {
487 int e = luaK_exp2anyreg(fs, ex);
488 luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0);
489 break;
490 }
491 case VGLOBAL: {
492 int e = luaK_exp2anyreg(fs, ex);
493 luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info);
494 break;
495 }
496 case VINDEXED: {
497 int e = luaK_exp2RK(fs, ex);
498 luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e);
499 break;
500 }
501 default: {
502 lua_assert(0); /* invalid var kind to store */
503 break;
504 }
505 }
506 freeexp(fs, ex);
507}
508
509
510void luaK_self (FuncState *fs, expdesc *e, expdesc *key) {

Callers 3

assignmentFunction · 0.85
localfuncFunction · 0.85
funcstatFunction · 0.85

Calls 6

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

Tested by

no test coverage detected