MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaK_nil

Function luaK_nil

ThirdParty/lua/lua/lcode.c:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54void luaK_nil (FuncState *fs, int from, int n) {
55 Instruction *previous;
56 int l = from + n - 1; /* last register to set nil */
57 if (fs->pc > fs->lasttarget) { /* no jumps to current position? */
58 previous = &fs->f->code[fs->pc-1];
59 if (GET_OPCODE(*previous) == OP_LOADNIL) {
60 int pfrom = GETARG_A(*previous);
61 int pl = pfrom + GETARG_B(*previous);
62 if ((pfrom <= from && from <= pl + 1) ||
63 (from <= pfrom && pfrom <= l + 1)) { /* can connect both? */
64 if (pfrom < from) from = pfrom; /* from = min(from, pfrom) */
65 if (pl > l) l = pl; /* l = max(l, pl) */
66 SETARG_A(*previous, from);
67 SETARG_B(*previous, l - from);
68 return;
69 }
70 } /* else go through */
71 }
72 luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0); /* else no optimization */
73}
74
75
76int luaK_jump (FuncState *fs) {

Callers 2

adjust_assignFunction · 0.85
discharge2regFunction · 0.85

Calls 1

luaK_codeABCFunction · 0.85

Tested by

no test coverage detected