MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaK_patchclose

Function luaK_patchclose

depends/lua/src/lcode.c:278–286  ·  view source on GitHub ↗

** Path all jumps in 'list' to close upvalues up to given 'level' ** (The assertion checks that jumps either were closing nothing ** or were closing higher levels, from inner blocks.) */

Source from the content-addressed store, hash-verified

276** or were closing higher levels, from inner blocks.)
277*/
278void luaK_patchclose (FuncState *fs, int list, int level) {
279 level++; /* argument is +1 to reserve 0 as non-op */
280 for (; list != NO_JUMP; list = getjump(fs, list)) {
281 lua_assert(GET_OPCODE(fs->f->code[list]) == OP_JMP &&
282 (GETARG_A(fs->f->code[list]) == 0 ||
283 GETARG_A(fs->f->code[list]) >= level));
284 SETARG_A(fs->f->code[list], level);
285 }
286}
287
288
289/*

Callers 4

findlabelFunction · 0.85
movegotosoutFunction · 0.85
leaveblockFunction · 0.85
repeatstatFunction · 0.85

Calls 1

getjumpFunction · 0.85

Tested by

no test coverage detected