diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-06-13 11:15:54 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-06-13 11:15:54 -0300 |
| commit | bf2b342ac1f080d06977bdf84475dc663c9a2644 (patch) | |
| tree | 54c51cdca0c34d1d125a34d4cb057adb561f7707 /ldo.c | |
| parent | 5fa2bec1f06f5b935036bd9e7c6a65b82f88dd39 (diff) | |
| download | lua-bf2b342ac1f080d06977bdf84475dc663c9a2644.tar.gz lua-bf2b342ac1f080d06977bdf84475dc663c9a2644.tar.bz2 lua-bf2b342ac1f080d06977bdf84475dc663c9a2644.zip | |
better control for compatibility code for varargs
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 2.24 2005/05/20 19:09:05 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.25 2005/05/31 14:25:18 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 | */ |
| @@ -199,8 +199,9 @@ static StkId adjust_varargs (lua_State *L, int nfixargs, int actual, | |||
| 199 | setnilvalue(L->top++); | 199 | setnilvalue(L->top++); |
| 200 | } | 200 | } |
| 201 | #if defined(LUA_COMPAT_VARARG) | 201 | #if defined(LUA_COMPAT_VARARG) |
| 202 | if (style != NEWSTYLEVARARG) { /* compatibility with old-style vararg */ | 202 | if (style & VARARG_NEEDSARG) { /* compatibility with old-style vararg */ |
| 203 | int nvar = actual - nfixargs; /* number of extra arguments */ | 203 | int nvar = actual - nfixargs; /* number of extra arguments */ |
| 204 | lua_assert(style & VARARG_HASARG); | ||
| 204 | luaC_checkGC(L); | 205 | luaC_checkGC(L); |
| 205 | htab = luaH_new(L, nvar, 1); /* create `arg' table */ | 206 | htab = luaH_new(L, nvar, 1); /* create `arg' table */ |
| 206 | for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */ | 207 | for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */ |
