aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-23 15:52:42 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-23 15:52:42 -0200
commit201288b4dfb6abb5a161e4358d878635f2ddb982 (patch)
tree96505f1465ebb3c261c903bf5690ee163ea036e6
parent62367dda449d2eb3c28b686664b920808ff0f334 (diff)
downloadlua-201288b4dfb6abb5a161e4358d878635f2ddb982.tar.gz
lua-201288b4dfb6abb5a161e4358d878635f2ddb982.tar.bz2
lua-201288b4dfb6abb5a161e4358d878635f2ddb982.zip
small bug
-rw-r--r--ldo.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ldo.c b/ldo.c
index 3cecc85b..a73c024f 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.34 2005/10/06 20:44:22 roberto Exp roberto $ 2** $Id: ldo.c,v 2.35 2005/10/14 16:23:33 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*/
@@ -276,8 +276,11 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
276 Proto *p = cl->p; 276 Proto *p = cl->p;
277 luaD_checkstack(L, p->maxstacksize); 277 luaD_checkstack(L, p->maxstacksize);
278 func = restorestack(L, funcr); 278 func = restorestack(L, funcr);
279 if (!p->is_vararg) /* no varargs? */ 279 if (!p->is_vararg) { /* no varargs? */
280 base = func + 1; 280 base = func + 1;
281 if (L->top > base + p->numparams)
282 L->top = base + p->numparams;
283 }
281 else { /* vararg function */ 284 else { /* vararg function */
282 int nargs = cast(int, L->top - func) - 1; 285 int nargs = cast(int, L->top - func) - 1;
283 base = adjust_varargs(L, p, nargs); 286 base = adjust_varargs(L, p, nargs);