MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / movegotosout

Function movegotosout

3rd/lua-5.4.3/src/lparser.c:616–627  ·  view source on GitHub ↗

** Adjust pending gotos to outer level of a block. */

Source from the content-addressed store, hash-verified

614** Adjust pending gotos to outer level of a block.
615*/
616static void movegotosout (FuncState *fs, BlockCnt *bl) {
617 int i;
618 Labellist *gl = &fs->ls->dyd->gt;
619 /* correct pending gotos to current block */
620 for (i = bl->firstgoto; i < gl->n; i++) { /* for each pending goto */
621 Labeldesc *gt = &gl->arr[i];
622 /* leaving a variable scope? */
623 if (reglevel(fs, gt->nactvar) > reglevel(fs, bl->nactvar))
624 gt->close |= bl->upval; /* jump may need a close */
625 gt->nactvar = bl->nactvar; /* update goto level */
626 }
627}
628
629
630static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isloop) {

Callers 1

leaveblockFunction · 0.85

Calls 1

reglevelFunction · 0.85

Tested by

no test coverage detected