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

Function fixforjump

third-party/lua-5.5.0/src/lparser.c:1645–1653  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1643** a back jump.
1644*/
1645static void fixforjump (FuncState *fs, int pc, int dest, int back) {
1646 Instruction *jmp = &fs->f->code[pc];
1647 int offset = dest - (pc + 1);
1648 if (back)
1649 offset = -offset;
1650 if (l_unlikely(offset > MAXARG_Bx))
1651 luaX_syntaxerror(fs->ls, "control structure too long");
1652 SETARG_Bx(*jmp, offset);
1653}
1654
1655
1656/*

Callers 1

forbodyFunction · 0.70

Calls 1

luaX_syntaxerrorFunction · 0.70

Tested by

no test coverage detected