MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / movegotosout

Function movegotosout

extlibs/lua/src/lparser.c:610–621  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

leaveblockFunction · 0.85

Calls 1

stacklevelFunction · 0.85

Tested by

no test coverage detected