| 35 | |
| 36 | |
| 37 | void 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 | |
| 59 | int luaK_jump (FuncState *fs) { |
no test coverage detected