MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / exp2reg

Function exp2reg

Source/Misc/lua/src/lua.c:4059–4080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4057
4058
4059static void exp2reg (FuncState *fs, expdesc *e, int reg) {
4060discharge2reg(fs, e, reg);
4061if (e->k == VJMP)
4062luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */
4063if (hasjumps(e)) {
4064int final; /* position after whole expression */
4065int p_f = NO_JUMP; /* position of an eventual LOAD false */
4066int p_t = NO_JUMP; /* position of an eventual LOAD true */
4067if (need_value(fs, e->t) || need_value(fs, e->f)) {
4068int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
4069p_f = code_label(fs, reg, 0, 1);
4070p_t = code_label(fs, reg, 1, 0);
4071luaK_patchtohere(fs, fj);
4072}
4073final = luaK_getlabel(fs);
4074patchlistaux(fs, e->f, final, reg, p_f);
4075patchlistaux(fs, e->t, final, reg, p_t);
4076}
4077e->f = e->t = NO_JUMP;
4078e->u.s.info = reg;
4079e->k = VNONRELOC;
4080}
4081
4082
4083void luaK_exp2nextreg (FuncState *fs, expdesc *e) {

Callers 3

luaK_exp2nextregFunction · 0.85
luaK_exp2anyregFunction · 0.85
luaK_storevarFunction · 0.85

Calls 8

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

Tested by

no test coverage detected