better control for compatibility code

This commit is contained in:
Roberto Ierusalimschy
2005-03-29 13:20:48 -03:00
parent 1c9c886974
commit e6e543a534
4 changed files with 43 additions and 10 deletions

4
ldo.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: ldo.c,v 2.19 2005/03/18 18:55:09 roberto Exp roberto $
** $Id: ldo.c,v 2.20 2005/03/28 17:17:53 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -197,6 +197,7 @@ static StkId adjust_varargs (lua_State *L, int nfixargs, int actual,
for (; actual < nfixargs; ++actual)
setnilvalue(L->top++);
}
#if LUA_COMPAT_VARARG
if (style != NEWSTYLEVARARG) { /* compatibility with old-style vararg */
int nvar = actual - nfixargs; /* number of extra arguments */
luaC_checkGC(L);
@@ -207,6 +208,7 @@ static StkId adjust_varargs (lua_State *L, int nfixargs, int actual,
setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")),
cast(lua_Number, nvar));
}
#endif
/* move fixed parameters to final position */
fixed = L->top - actual; /* first fixed argument */
base = L->top; /* final position of first argument */