MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / fixforjump

Function fixforjump

lib/lua/src/lparser.c:1530–1538  ·  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

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

Callers 1

forbodyFunction · 0.85

Calls 1

luaX_syntaxerrorFunction · 0.85

Tested by

no test coverage detected