MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaK_dischargevars

Function luaK_dischargevars

ThirdParty/lua/lua/lcode.c:406–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404
405
406void luaK_dischargevars (FuncState *fs, expdesc *e) {
407 switch (e->k) {
408 case VLOCAL: {
409 e->k = VNONRELOC;
410 break;
411 }
412 case VUPVAL: {
413 e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0);
414 e->k = VRELOCABLE;
415 break;
416 }
417 case VINDEXED: {
418 OpCode op = OP_GETTABUP; /* assume 't' is in an upvalue */
419 freereg(fs, e->u.ind.idx);
420 if (e->u.ind.vt == VLOCAL) { /* 't' is in a register? */
421 freereg(fs, e->u.ind.t);
422 op = OP_GETTABLE;
423 }
424 e->u.info = luaK_codeABC(fs, op, 0, e->u.ind.t, e->u.ind.idx);
425 e->k = VRELOCABLE;
426 break;
427 }
428 case VVARARG:
429 case VCALL: {
430 luaK_setoneret(fs, e);
431 break;
432 }
433 default: break; /* there is one value available (somewhere) */
434 }
435}
436
437
438static int code_label (FuncState *fs, int A, int b, int jump) {

Callers 9

primaryexpFunction · 0.85
discharge2regFunction · 0.85
luaK_exp2nextregFunction · 0.85
luaK_exp2anyregFunction · 0.85
luaK_exp2valFunction · 0.85
luaK_goiftrueFunction · 0.85
luaK_goiffalseFunction · 0.85
codenotFunction · 0.85
luaK_posfixFunction · 0.85

Calls 3

luaK_codeABCFunction · 0.85
freeregFunction · 0.85
luaK_setoneretFunction · 0.85

Tested by

no test coverage detected