MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaK_exp2anyreg

Function luaK_exp2anyreg

libraries/AP_Scripting/lua/src/lcode.c:722–734  ·  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

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

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