Пример #1
0
static Proto * LoadFunction(LoadState * S, TString * p)
{
	Proto* f;

	if(++S->L->nCcalls > LUAI_MAXCCALLS)
		error(S,"code too deep");

	f=luaF_newproto(S->L);
	setptvalue2s(S->L,S->L->top,f); incr_top(S->L);

	f->source=LoadString(S);
	if(f->source==NULL)
		f->source=p;
	f->linedefined=LoadInt(S);
	f->lastlinedefined=LoadInt(S);
	f->nups=LoadByte(S);
	f->numparams=LoadByte(S);
	f->is_vararg=LoadByte(S);
	f->maxstacksize=LoadByte(S);
	LoadCode(S,f);
	LoadConstants(S,f);
	LoadDebug(S,f);
	IF (!luaG_checkcode(f), "bad code");
	S->L->top--;
	S->L->nCcalls--;
	return f;
}
Пример #2
0
static void LoadFunction(LoadState* S, Proto* f)
{
 f->linedefined=LoadInt(S);
 f->lastlinedefined=LoadInt(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadCode(S,f);
 LoadConstants(S,f);
 LoadUpvalues(S,f);
 LoadDebug(S,f);
}
Пример #3
0
static void LoadFunction (LoadState *S, Proto *f, TString *psource) {
  f->source = LoadString(S);
  if (f->source == NULL)  /* no source in dump? */
    f->source = psource;  /* reuse parent's source */
  f->linedefined = LoadInt(S);
  f->lastlinedefined = LoadInt(S);
  f->numparams = LoadByte(S);
  f->is_vararg = LoadByte(S);
  f->maxstacksize = LoadByte(S);
  LoadCode(S, f);
  LoadConstants(S, f);
  LoadUpvalues(S, f);
  LoadProtos(S, f);
  LoadDebug(S, f);
}
Пример #4
0
static Proto* LoadFunction(LoadState* S)
{
 Proto* f=luaF_newproto(S->L);
 setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
 f->linedefined=LoadInt(S);
 f->lastlinedefined=LoadInt(S);
 f->numparams=LoadByte(S);
 f->is_vararg=LoadByte(S);
 f->maxstacksize=LoadByte(S);
 LoadCode(S,f);
 LoadConstants(S,f);
 LoadUpvalues(S,f);
 LoadDebug(S,f);
 S->L->top--;
 return f;
}