| 33 | |
| 34 | |
| 35 | void luaK_nil (FuncState *fs, int from, int n) { |
| 36 | Instruction *previous; |
| 37 | if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ |
| 38 | if (fs->pc == 0) { /* function start? */ |
| 39 | if (from >= fs->nactvar) |
| 40 | return; /* positions are already clean */ |
| 41 | } |
| 42 | else { |
| 43 | previous = &fs->f->code[fs->pc-1]; |
| 44 | if (GET_OPCODE(*previous) == OP_LOADNIL) { |
| 45 | int pfrom = GETARG_A(*previous); |
| 46 | int pto = GETARG_B(*previous); |
| 47 | if (pfrom <= from && from <= pto+1) { /* can connect both? */ |
| 48 | if (from+n-1 > pto) |
| 49 | SETARG_B(*previous, from+n-1); |
| 50 | return; |
| 51 | } |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */ |
| 56 | } |
| 57 | |
| 58 | |
| 59 | int luaK_jump (FuncState *fs) { |
no test coverage detected