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

Function luaK_nil

third-party/lua-5.2.4/src/lcode.c:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36
37void luaK_nil (FuncState *fs, int from, int n) {
38 Instruction *previous;
39 int l = from + n - 1; /* last register to set nil */
40 if (fs->pc > fs->lasttarget) { /* no jumps to current position? */
41 previous = &fs->f->code[fs->pc-1];
42 if (GET_OPCODE(*previous) == OP_LOADNIL) {
43 int pfrom = GETARG_A(*previous);
44 int pl = pfrom + GETARG_B(*previous);
45 if ((pfrom <= from && from <= pl + 1) ||
46 (from <= pfrom && pfrom <= l + 1)) { /* can connect both? */
47 if (pfrom < from) from = pfrom; /* from = min(from, pfrom) */
48 if (pl > l) l = pl; /* l = max(l, pl) */
49 SETARG_A(*previous, from);
50 SETARG_B(*previous, l - from);
51 return;
52 }
53 } /* else go through */
54 }
55 luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0); /* else no optimization */
56}
57
58
59int luaK_jump (FuncState *fs) {

Callers 2

adjust_assignFunction · 0.70
discharge2regFunction · 0.70

Calls 1

luaK_codeABCFunction · 0.70

Tested by

no test coverage detected