** adds a new prototype into list of prototypes */
| 684 | ** adds a new prototype into list of prototypes |
| 685 | */ |
| 686 | static Proto *addprototype (LexState *ls) { |
| 687 | Proto *clp; |
| 688 | lua_State *L = ls->L; |
| 689 | FuncState *fs = ls->fs; |
| 690 | Proto *f = fs->f; /* prototype of current function */ |
| 691 | if (fs->np >= f->sizep) { |
| 692 | int oldsize = f->sizep; |
| 693 | luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions"); |
| 694 | while (oldsize < f->sizep) |
| 695 | f->p[oldsize++] = NULL; |
| 696 | } |
| 697 | f->p[fs->np++] = clp = luaF_newproto(L); |
| 698 | luaC_objbarrier(L, f, clp); |
| 699 | return clp; |
| 700 | } |
| 701 | |
| 702 | |
| 703 | /* |