MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / leaveblock

Function leaveblock

deps/lua/src/lparser.c:296–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294
295
296static void leaveblock (FuncState *fs) {
297 BlockCnt *bl = fs->bl;
298 fs->bl = bl->previous;
299 removevars(fs->ls, bl->nactvar);
300 if (bl->upval)
301 luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
302 /* a block either controls scope or breaks (never both) */
303 lua_assert(!bl->isbreakable || !bl->upval);
304 lua_assert(bl->nactvar == fs->nactvar);
305 fs->freereg = fs->nactvar; /* free registers */
306 luaK_patchtohere(fs, bl->breaklist);
307}
308
309
310static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {

Callers 5

blockFunction · 0.85
whilestatFunction · 0.85
repeatstatFunction · 0.85
forbodyFunction · 0.85
forstatFunction · 0.85

Calls 3

removevarsFunction · 0.85
luaK_codeABCFunction · 0.85
luaK_patchtohereFunction · 0.85

Tested by

no test coverage detected