MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaK_patchclose

Function luaK_patchclose

libraries/AP_Scripting/lua/src/lcode.c:285–293  ·  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

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

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