diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-29 13:20:48 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-29 13:20:48 -0300 |
| commit | e6e543a534832d7bb5680cee9d3b589a69c5e2cc (patch) | |
| tree | 934ca8b2d6411cad63174f699857f82875940622 /ldo.c | |
| parent | 1c9c8869741897d67b64a27410f3856d34415e87 (diff) | |
| download | lua-e6e543a534832d7bb5680cee9d3b589a69c5e2cc.tar.gz lua-e6e543a534832d7bb5680cee9d3b589a69c5e2cc.tar.bz2 lua-e6e543a534832d7bb5680cee9d3b589a69c5e2cc.zip | |
better control for compatibility code
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 2.19 2005/03/18 18:55:09 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.20 2005/03/28 17:17:53 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -197,6 +197,7 @@ static StkId adjust_varargs (lua_State *L, int nfixargs, int actual, | |||
| 197 | for (; actual < nfixargs; ++actual) | 197 | for (; actual < nfixargs; ++actual) |
| 198 | setnilvalue(L->top++); | 198 | setnilvalue(L->top++); |
| 199 | } | 199 | } |
| 200 | #if LUA_COMPAT_VARARG | ||
| 200 | if (style != NEWSTYLEVARARG) { /* compatibility with old-style vararg */ | 201 | if (style != NEWSTYLEVARARG) { /* compatibility with old-style vararg */ |
| 201 | int nvar = actual - nfixargs; /* number of extra arguments */ | 202 | int nvar = actual - nfixargs; /* number of extra arguments */ |
| 202 | luaC_checkGC(L); | 203 | luaC_checkGC(L); |
| @@ -207,6 +208,7 @@ static StkId adjust_varargs (lua_State *L, int nfixargs, int actual, | |||
| 207 | setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), | 208 | setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), |
| 208 | cast(lua_Number, nvar)); | 209 | cast(lua_Number, nvar)); |
| 209 | } | 210 | } |
| 211 | #endif | ||
| 210 | /* move fixed parameters to final position */ | 212 | /* move fixed parameters to final position */ |
| 211 | fixed = L->top - actual; /* first fixed argument */ | 213 | fixed = L->top - actual; /* first fixed argument */ |
| 212 | base = L->top; /* final position of first argument */ | 214 | base = L->top; /* final position of first argument */ |
