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

Function newgotoentry

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

** Create an entry for the goto and the code for it. As it is not known ** at this point whether the goto may need a CLOSE, the code has a jump ** followed by an CLOSE. (As the CLOSE comes after the jump, it is a ** dead instruction; it works as a placeholder.) When the goto is closed ** against a label, if it needs a CLOSE, the two instructions swap ** positions, so that the CLOSE comes before th

Source from the content-addressed store, hash-verified

661** positions, so that the CLOSE comes before the jump.
662*/
663static int newgotoentry (LexState *ls, TString *name, int line) {
664 FuncState *fs = ls->fs;
665 int pc = luaK_jump(fs); /* create jump */
666 luaK_codeABC(fs, OP_CLOSE, 0, 1, 0); /* spaceholder, marked as dead */
667 return newlabelentry(ls, &ls->dyd->gt, name, line, pc);
668}
669
670
671/*

Callers 2

gotostatFunction · 0.70
breakstatFunction · 0.70

Calls 3

luaK_jumpFunction · 0.70
newlabelentryFunction · 0.70
luaK_codeABCFunction · 0.50

Tested by

no test coverage detected