| 385 | |
| 386 | |
| 387 | static void close_func (LexState *ls) { |
| 388 | lua_State *L = ls->L; |
| 389 | FuncState *fs = ls->fs; |
| 390 | Proto *f = fs->f; |
| 391 | removevars(ls, 0); |
| 392 | luaK_ret(fs, 0, 0); /* final return */ |
| 393 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); |
| 394 | f->sizecode = fs->pc; |
| 395 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); |
| 396 | f->sizelineinfo = fs->pc; |
| 397 | luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); |
| 398 | f->sizek = fs->nk; |
| 399 | luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); |
| 400 | f->sizep = fs->np; |
| 401 | luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); |
| 402 | f->sizelocvars = fs->nlocvars; |
| 403 | luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); |
| 404 | f->sizeupvalues = f->nups; |
| 405 | lua_assert(luaG_checkcode(f)); |
| 406 | lua_assert(fs->bl == NULL); |
| 407 | ls->fs = fs->prev; |
| 408 | L->top -= 2; /* remove table and prototype from the stack */ |
| 409 | /* last token read was anchored in defunct function; must reanchor it */ |
| 410 | if (fs) anchor_token(ls); |
| 411 | } |
| 412 | |
| 413 | |
| 414 | Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { |
no test coverage detected