MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaK_nil

Function luaK_nil

freebsd/contrib/openzfs/module/lua/lcode.c:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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