** adds a new prototype into list of prototypes */
| 517 | ** adds a new prototype into list of prototypes |
| 518 | */ |
| 519 | static Proto *addprototype(LexState *ls) { |
| 520 | Proto *clp; |
| 521 | lua_State *L = ls->L; |
| 522 | FuncState *fs = ls->fs; |
| 523 | Proto *f = fs->f; /* prototype of current function */ |
| 524 | if (fs->np >= f->sizep) { |
| 525 | int oldsize = f->sizep; |
| 526 | luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions"); |
| 527 | while (oldsize < f->sizep) f->p[oldsize++] = nullptr; |
| 528 | } |
| 529 | f->p[fs->np++] = clp = luaF_newproto(L); |
| 530 | luaC_objbarrier(L, f, clp); |
| 531 | return clp; |
| 532 | } |
| 533 | |
| 534 | |
| 535 | /* |