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

Function reglevel

third-party/lua-5.5.0/src/lparser.c:236–243  ·  view source on GitHub ↗

** Convert 'nvar', a compiler index level, to its corresponding ** register. For that, search for the highest variable below that level ** that is in a register and uses its register index ('ridx') plus one. */

Source from the content-addressed store, hash-verified

234** that is in a register and uses its register index ('ridx') plus one.
235*/
236static lu_byte reglevel (FuncState *fs, int nvar) {
237 while (nvar-- > 0) {
238 Vardesc *vd = getlocalvardesc(fs, nvar); /* get previous variable */
239 if (varinreg(vd)) /* is in a register? */
240 return cast_byte(vd->vd.ridx + 1);
241 }
242 return 0; /* no variables in registers */
243}
244
245
246/*

Callers 6

luaY_nvarstackFunction · 0.70
closegotoFunction · 0.70
solvegotosFunction · 0.70
leaveblockFunction · 0.70
repeatstatFunction · 0.70
checktocloseFunction · 0.70

Calls 1

getlocalvardescFunction · 0.70

Tested by

no test coverage detected