aboutsummaryrefslogtreecommitdiff
path: root/ltm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-15 11:07:10 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-15 11:07:10 -0200
commitb3f924bc695ed6ebe2539d365197696e41863a91 (patch)
treebf756351d06bdfc469846e533699c9ce58bc3566 /ltm.c
parente001d5aea693ca1bcf1a4dfd2f900737fc0a8604 (diff)
downloadlua-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ltm.c b/ltm.c
index d30bef2f..049c1712 100644
--- a/ltm.c
+++ b/ltm.c
@@ -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 */