MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / fixforjump

Function fixforjump

extlibs/lua/src/lparser.c:1511–1519  ·  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

1509** a back jump.
1510*/
1511static void fixforjump (FuncState *fs, int pc, int dest, int back) {
1512 Instruction *jmp = &fs->f->code[pc];
1513 int offset = dest - (pc + 1);
1514 if (back)
1515 offset = -offset;
1516 if (unlikely(offset > MAXARG_Bx))
1517 luaX_syntaxerror(fs->ls, "control structure too long");
1518 SETARG_Bx(*jmp, offset);
1519}
1520
1521
1522/*

Callers 1

forbodyFunction · 0.85

Calls 1

luaX_syntaxerrorFunction · 0.85

Tested by

no test coverage detected