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

Function luaK_exp2anyreg

third-party/lua-5.5.0/src/lcode.c:1011–1026  ·  view source on GitHub ↗

** Ensures final expression result is in some (any) register ** and return that register. */

Source from the content-addressed store, hash-verified

1009** and return that register.
1010*/
1011int luaK_exp2anyreg (FuncState *fs, expdesc *e) {
1012 luaK_dischargevars(fs, e);
1013 if (e->k == VNONRELOC) { /* expression already has a register? */
1014 if (!hasjumps(e)) /* no jumps? */
1015 return e->u.info; /* result is already in a register */
1016 if (e->u.info >= luaY_nvarstack(fs)) { /* reg. is not a local? */
1017 exp2reg(fs, e, e->u.info); /* put final result in it */
1018 return e->u.info;
1019 }
1020 /* else expression has jumps and cannot change its register
1021 to hold the jump values, because it is a local variable.
1022 Go through to the default case. */
1023 }
1024 luaK_exp2nextreg(fs, e); /* default: use next available register */
1025 return e->u.info;
1026}
1027
1028
1029/*

Callers 14

retstatFunction · 0.70
luaK_codecheckglobalFunction · 0.70
luaK_exp2anyregupFunction · 0.70
luaK_exp2valFunction · 0.70
exp2RKFunction · 0.70
luaK_storevarFunction · 0.70
luaK_selfFunction · 0.70
luaK_indexedFunction · 0.70
codeunexpvalFunction · 0.70
finishbinexpvalFunction · 0.70
codebinexpvalFunction · 0.70
codeorderFunction · 0.70

Calls 4

luaK_dischargevarsFunction · 0.70
luaY_nvarstackFunction · 0.70
exp2regFunction · 0.70
luaK_exp2nextregFunction · 0.70

Tested by

no test coverage detected