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

Function luaK_dischargevars

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

Source from the content-addressed store, hash-verified

381
382
383void luaK_dischargevars (FuncState *fs, expdesc *e) {
384 switch (e->k) {
385 case VLOCAL: {
386 e->k = VNONRELOC;
387 break;
388 }
389 case VUPVAL: {
390 e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0);
391 e->k = VRELOCABLE;
392 break;
393 }
394 case VINDEXED: {
395 OpCode op = OP_GETTABUP; /* assume 't' is in an upvalue */
396 freereg(fs, e->u.ind.idx);
397 if (e->u.ind.vt == VLOCAL) { /* 't' is in a register? */
398 freereg(fs, e->u.ind.t);
399 op = OP_GETTABLE;
400 }
401 e->u.info = luaK_codeABC(fs, op, 0, e->u.ind.t, e->u.ind.idx);
402 e->k = VRELOCABLE;
403 break;
404 }
405 case VVARARG:
406 case VCALL: {
407 luaK_setoneret(fs, e);
408 break;
409 }
410 default: break; /* there is one value available (somewhere) */
411 }
412}
413
414
415static int code_label (FuncState *fs, int A, int b, int jump) {

Callers 9

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

Calls 3

luaK_codeABCFunction · 0.70
freeregFunction · 0.70
luaK_setoneretFunction · 0.70

Tested by

no test coverage detected