MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaK_exp2anyreg

Function luaK_exp2anyreg

depends/lua/src/lcode.c:715–727  ·  view source on GitHub ↗

** Ensures final expression result (including results from its jump ** lists) is in some (any) register and return that register. */

Source from the content-addressed store, hash-verified

713** lists) is in some (any) register and return that register.
714*/
715int luaK_exp2anyreg (FuncState *fs, expdesc *e) {
716 luaK_dischargevars(fs, e);
717 if (e->k == VNONRELOC) { /* expression already has a register? */
718 if (!hasjumps(e)) /* no jumps? */
719 return e->u.info; /* result is already in a register */
720 if (e->u.info >= fs->nactvar) { /* reg. is not a local? */
721 exp2reg(fs, e, e->u.info); /* put final result in it */
722 return e->u.info;
723 }
724 }
725 luaK_exp2nextreg(fs, e); /* otherwise, use next available register */
726 return e->u.info;
727}
728
729
730/*

Callers 7

retstatFunction · 0.85
luaK_exp2anyregupFunction · 0.85
luaK_exp2valFunction · 0.85
luaK_exp2RKFunction · 0.85
luaK_storevarFunction · 0.85
luaK_selfFunction · 0.85
codeunexpvalFunction · 0.85

Calls 3

luaK_dischargevarsFunction · 0.85
exp2regFunction · 0.85
luaK_exp2nextregFunction · 0.85

Tested by

no test coverage detected