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

Function fixforjump

third-party/lua-5.4.6/src/lparser.c:1529–1537  ·  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

1527** a back jump.
1528*/
1529static void fixforjump (FuncState *fs, int pc, int dest, int back) {
1530 Instruction *jmp = &fs->f->code[pc];
1531 int offset = dest - (pc + 1);
1532 if (back)
1533 offset = -offset;
1534 if (l_unlikely(offset > MAXARG_Bx))
1535 luaX_syntaxerror(fs->ls, "control structure too long");
1536 SETARG_Bx(*jmp, offset);
1537}
1538
1539
1540/*

Callers 1

forbodyFunction · 0.70

Calls 1

luaX_syntaxerrorFunction · 0.70

Tested by

no test coverage detected