| 52 | |
| 53 | |
| 54 | void 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 | |
| 76 | int luaK_jump (FuncState *fs) { |
no test coverage detected