| 7930 | |
| 7931 | |
| 7932 | static void close_func (LexState *ls) { |
| 7933 | lua_State *L = ls->L; |
| 7934 | FuncState *fs = ls->fs; |
| 7935 | Proto *f = fs->f; |
| 7936 | removevars(ls, 0); |
| 7937 | luaK_ret(fs, 0, 0); /* final return */ |
| 7938 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); |
| 7939 | f->sizecode = fs->pc; |
| 7940 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); |
| 7941 | f->sizelineinfo = fs->pc; |
| 7942 | luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); |
| 7943 | f->sizek = fs->nk; |
| 7944 | luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); |
| 7945 | f->sizep = fs->np; |
| 7946 | luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); |
| 7947 | f->sizelocvars = fs->nlocvars; |
| 7948 | luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); |
| 7949 | f->sizeupvalues = f->nups; |
| 7950 | lua_assert(luaG_checkcode(f)); |
| 7951 | lua_assert(fs->bl == NULL); |
| 7952 | ls->fs = fs->prev; |
| 7953 | L->top -= 2; /* remove table and prototype from the stack */ |
| 7954 | /* last token read was anchored in defunct function; must reanchor it */ |
| 7955 | if (fs) anchor_token(ls); |
| 7956 | } |
| 7957 | |
| 7958 | |
| 7959 | Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { |
no test coverage detected