MCPcopy Create free account
hub / github.com/F-Stack/f-stack / leaveblock

Function leaveblock

freebsd/contrib/openzfs/module/lua/lparser.c:470–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468
469
470static void leaveblock (FuncState *fs) {
471 BlockCnt *bl = fs->bl;
472 LexState *ls = fs->ls;
473 if (bl->previous && bl->upval) {
474 /* create a 'jump to here' to close upvalues */
475 int j = luaK_jump(fs);
476 luaK_patchclose(fs, j, bl->nactvar);
477 luaK_patchtohere(fs, j);
478 }
479 if (bl->isloop)
480 breaklabel(ls); /* close pending breaks */
481 fs->bl = bl->previous;
482 removevars(fs, bl->nactvar);
483 lua_assert(bl->nactvar == fs->nactvar);
484 fs->freereg = fs->nactvar; /* free registers */
485 ls->dyd->label.n = bl->firstlabel; /* remove local labels */
486 if (bl->previous) /* inner block? */
487 movegotosout(fs, bl); /* update pending gotos to outer block */
488 else if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */
489 undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */
490}
491
492
493/*

Callers 7

close_funcFunction · 0.70
blockFunction · 0.70
whilestatFunction · 0.70
repeatstatFunction · 0.70
forbodyFunction · 0.70
forstatFunction · 0.70
test_then_blockFunction · 0.70

Calls 7

luaK_patchcloseFunction · 0.85
breaklabelFunction · 0.85
movegotosoutFunction · 0.85
undefgotoFunction · 0.85
luaK_jumpFunction · 0.70
luaK_patchtohereFunction · 0.70
removevarsFunction · 0.70

Tested by 1

test_then_blockFunction · 0.56