First "complete" implementation of to-be-closed variables

Still missing:
- handling of memory errors when creating upvalue (must run closing
method all the same)
- interaction with coroutines
This commit is contained in:
Roberto Ierusalimschy
2018-10-17 10:44:42 -03:00
parent 4cd1f4aac0
commit bd96330d03
13 changed files with 145 additions and 26 deletions

View File

@@ -1536,9 +1536,9 @@ static void scopedlocalstat (LexState *ls) {
FuncState *fs = ls->fs;
new_localvar(ls, str_checkname(ls));
checknext(ls, '=');
exp1(ls, 0);
luaK_codeABC(fs, OP_TBC, fs->nactvar, 0, 0);
markupval(fs, fs->nactvar);
exp1(ls, 0);
adjustlocalvars(ls, 1);
}