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

Function exp2reg

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

Source from the content-addressed store, hash-verified

466
467
468static void exp2reg (FuncState *fs, expdesc *e, int reg) {
469 discharge2reg(fs, e, reg);
470 if (e->k == VJMP)
471 luaK_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */
472 if (hasjumps(e)) {
473 int final; /* position after whole expression */
474 int p_f = NO_JUMP; /* position of an eventual LOAD false */
475 int p_t = NO_JUMP; /* position of an eventual LOAD true */
476 if (need_value(fs, e->t) || need_value(fs, e->f)) {
477 int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
478 p_f = code_label(fs, reg, 0, 1);
479 p_t = code_label(fs, reg, 1, 0);
480 luaK_patchtohere(fs, fj);
481 }
482 final = luaK_getlabel(fs);
483 patchlistaux(fs, e->f, final, reg, p_f);
484 patchlistaux(fs, e->t, final, reg, p_t);
485 }
486 e->f = e->t = NO_JUMP;
487 e->u.info = reg;
488 e->k = VNONRELOC;
489}
490
491
492void luaK_exp2nextreg (FuncState *fs, expdesc *e) {

Callers 3

luaK_exp2nextregFunction · 0.70
luaK_exp2anyregFunction · 0.70
luaK_storevarFunction · 0.70

Calls 8

discharge2regFunction · 0.70
luaK_concatFunction · 0.70
need_valueFunction · 0.70
luaK_jumpFunction · 0.70
code_labelFunction · 0.70
luaK_patchtohereFunction · 0.70
luaK_getlabelFunction · 0.70
patchlistauxFunction · 0.70

Tested by

no test coverage detected