| 159 | } |
| 160 | |
| 161 | static Proto* LoadFunction(LoadState* S, TString* p) |
| 162 | { |
| 163 | Proto* f; |
| 164 | if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); |
| 165 | f=luaF_newproto(S->L); |
| 166 | setptvalue2s(S->L,S->L->top,f); incr_top(S->L); |
| 167 | f->source=LoadString(S); if (f->source==NULL) f->source=p; |
| 168 | f->linedefined=LoadInt(S); |
| 169 | f->lastlinedefined=LoadInt(S); |
| 170 | f->nups=LoadByte(S); |
| 171 | f->numparams=LoadByte(S); |
| 172 | f->is_vararg=LoadByte(S); |
| 173 | f->maxstacksize=LoadByte(S); |
| 174 | LoadCode(S,f); |
| 175 | LoadConstants(S,f); |
| 176 | LoadDebug(S,f); |
| 177 | IF (!luaG_checkcode(f), "bad code"); |
| 178 | S->L->top--; |
| 179 | S->L->nCcalls--; |
| 180 | return f; |
| 181 | } |
| 182 | |
| 183 | static void LoadHeader(LoadState* S) |
| 184 | { |
no test coverage detected