MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaK_nil

Function luaK_nil

Source/Misc/lua/src/lua.c:3704–3725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3702
3703
3704void luaK_nil (FuncState *fs, int from, int n) {
3705Instruction *previous;
3706if (fs->pc > fs->lasttarget) { /* no jumps to current position? */
3707if (fs->pc == 0) { /* function start? */
3708if (from >= fs->nactvar)
3709return; /* positions are already clean */
3710}
3711else {
3712previous = &fs->f->code[fs->pc-1];
3713if (GET_OPCODE(*previous) == OP_LOADNIL) {
3714int pfrom = GETARG_A(*previous);
3715int pto = GETARG_B(*previous);
3716if (pfrom <= from && from <= pto+1) { /* can connect both? */
3717if (from+n-1 > pto)
3718SETARG_B(*previous, from+n-1);
3719return;
3720}
3721}
3722}
3723}
3724luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */
3725}
3726
3727
3728int luaK_jump (FuncState *fs) {

Callers 2

discharge2regFunction · 0.85
adjust_assignFunction · 0.85

Calls 1

luaK_codeABCFunction · 0.85

Tested by

no test coverage detected