** adds a new prototype into list of prototypes */
| 497 | ** adds a new prototype into list of prototypes |
| 498 | */ |
| 499 | static Proto *addprototype (LexState *ls) { |
| 500 | Proto *clp; |
| 501 | lua_State *L = ls->L; |
| 502 | FuncState *fs = ls->fs; |
| 503 | Proto *f = fs->f; /* prototype of current function */ |
| 504 | if (fs->np >= f->sizep) { |
| 505 | int oldsize = f->sizep; |
| 506 | luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions"); |
| 507 | while (oldsize < f->sizep) |
| 508 | f->p[oldsize++] = NULL; |
| 509 | } |
| 510 | f->p[fs->np++] = clp = luaF_newproto(L); |
| 511 | luaC_objbarrier(L, f, clp); |
| 512 | return clp; |
| 513 | } |
| 514 | |
| 515 | |
| 516 | /* |