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