diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-13 14:08:47 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-13 14:08:47 -0200 |
commit | 15db58a2f5293add82ef447c466f3ea950705593 (patch) | |
tree | e4d419df92c122f58964b2073014db157efa5744 | |
parent | d6826dbc80f9ce4611a26032274231d46556fe94 (diff) | |
download | lua-15db58a2f5293add82ef447c466f3ea950705593.tar.gz lua-15db58a2f5293add82ef447c466f3ea950705593.tar.bz2 lua-15db58a2f5293add82ef447c466f3ea950705593.zip |
create arg table with correct size
-rw-r--r-- | ldo.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.211 2002/12/04 17:38:31 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.212 2003/01/23 11:31:38 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 | */ |
@@ -187,7 +187,7 @@ static void adjust_varargs (lua_State *L, int nfixargs, StkId base) { | |||
187 | setnilvalue(L->top++); | 187 | setnilvalue(L->top++); |
188 | } | 188 | } |
189 | actual -= nfixargs; /* number of extra arguments */ | 189 | actual -= nfixargs; /* number of extra arguments */ |
190 | htab = luaH_new(L, 0, 0); /* create `arg' table */ | 190 | htab = luaH_new(L, actual, 1); /* create `arg' table */ |
191 | for (i=0; i<actual; i++) /* put extra arguments into `arg' table */ | 191 | for (i=0; i<actual; i++) /* put extra arguments into `arg' table */ |
192 | setobj2n(luaH_setnum(L, htab, i+1), L->top - actual + i); | 192 | setobj2n(luaH_setnum(L, htab, i+1), L->top - actual + i); |
193 | /* store counter in field `n' */ | 193 | /* store counter in field `n' */ |