MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / fixjump

Function fixjump

third-party/lua-5.5.0/src/lcode.c:168–176  ·  view source on GitHub ↗

** Fix jump instruction at position 'pc' to jump to 'dest'. ** (Jump addresses are relative in Lua) */

Source from the content-addressed store, hash-verified

166** (Jump addresses are relative in Lua)
167*/
168static void fixjump (FuncState *fs, int pc, int dest) {
169 Instruction *jmp = &fs->f->code[pc];
170 int offset = dest - (pc + 1);
171 lua_assert(dest != NO_JUMP);
172 if (!(-OFFSET_sJ <= offset && offset <= MAXARG_sJ - OFFSET_sJ))
173 luaX_syntaxerror(fs->ls, "control structure too long");
174 lua_assert(GET_OPCODE(*jmp) == OP_JMP);
175 SETARG_sJ(*jmp, offset);
176}
177
178
179/*

Callers 3

luaK_concatFunction · 0.70
patchlistauxFunction · 0.70
luaK_finishFunction · 0.70

Calls 1

luaX_syntaxerrorFunction · 0.70

Tested by

no test coverage detected