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

Function codeclosure

third-party/lua-5.2.4/src/lparser.c:520–524  ·  view source on GitHub ↗

** codes instruction to create new closure in parent function. ** The OP_CLOSURE instruction must use the last available register, ** so that, if it invokes the GC, the GC knows which registers ** are in use at that time. */

Source from the content-addressed store, hash-verified

518** are in use at that time.
519*/
520static void codeclosure (LexState *ls, expdesc *v) {
521 FuncState *fs = ls->fs->prev;
522 init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np - 1));
523 luaK_exp2nextreg(fs, v); /* fix it at the last register */
524}
525
526
527static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) {

Callers 1

bodyFunction · 0.70

Calls 3

init_expFunction · 0.70
luaK_codeABxFunction · 0.70
luaK_exp2nextregFunction · 0.70

Tested by

no test coverage detected