From b3f924bc695ed6ebe2539d365197696e41863a91 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 15 Dec 2017 11:07:10 -0200 Subject: 'Proto->numparams' does not include vararg parameter (one less subtraction when calling functions...) --- ltm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index d30bef2f..049c1712 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.51 2017/11/30 15:37:16 roberto Exp roberto $ +** $Id: ltm.c,v 2.52 2017/12/13 18:32:09 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -219,7 +219,7 @@ void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) { int i; Table *vtab; TValue nname; - int nfixparams = p->numparams - 1; /* number of fixed parameters */ + int nfixparams = p->numparams; /* number of fixed parameters */ actual -= nfixparams; /* number of extra arguments */ vtab = luaH_new(L); /* create vararg table */ sethvalue2s(L, L->top, vtab); /* anchor it for resizing */ -- cgit v1.2.3-55-g6feb