diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-15 11:07:10 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-15 11:07:10 -0200 |
commit | b3f924bc695ed6ebe2539d365197696e41863a91 (patch) | |
tree | bf756351d06bdfc469846e533699c9ce58bc3566 /ltm.c | |
parent | e001d5aea693ca1bcf1a4dfd2f900737fc0a8604 (diff) | |
download | lua-b3f924bc695ed6ebe2539d365197696e41863a91.tar.gz lua-b3f924bc695ed6ebe2539d365197696e41863a91.tar.bz2 lua-b3f924bc695ed6ebe2539d365197696e41863a91.zip |
'Proto->numparams' does not include vararg parameter
(one less subtraction when calling functions...)
Diffstat (limited to 'ltm.c')
-rw-r--r-- | ltm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 2.51 2017/11/30 15:37:16 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.52 2017/12/13 18:32:09 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -219,7 +219,7 @@ void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) { | |||
219 | int i; | 219 | int i; |
220 | Table *vtab; | 220 | Table *vtab; |
221 | TValue nname; | 221 | TValue nname; |
222 | int nfixparams = p->numparams - 1; /* number of fixed parameters */ | 222 | int nfixparams = p->numparams; /* number of fixed parameters */ |
223 | actual -= nfixparams; /* number of extra arguments */ | 223 | actual -= nfixparams; /* number of extra arguments */ |
224 | vtab = luaH_new(L); /* create vararg table */ | 224 | vtab = luaH_new(L); /* create vararg table */ |
225 | sethvalue2s(L, L->top, vtab); /* anchor it for resizing */ | 225 | sethvalue2s(L, L->top, vtab); /* anchor it for resizing */ |