diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-08-01 16:51:24 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-08-01 16:51:24 -0300 |
commit | e4a9e6fcca4ac2a14c9832b1a40b74cdca7016b9 (patch) | |
tree | f4e6a467d530017d905a331ea41114cb9333ffd4 /ldo.c | |
parent | 9de2bb0d62a2531c47e5b8197f57a48c9aea05d2 (diff) | |
download | lua-e4a9e6fcca4ac2a14c9832b1a40b74cdca7016b9.tar.gz lua-e4a9e6fcca4ac2a14c9832b1a40b74cdca7016b9.tar.bz2 lua-e4a9e6fcca4ac2a14c9832b1a40b74cdca7016b9.zip |
do not eliminate varargs from functions that do not use varargs
(confuses the debug lib and gains very little in performance)
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.151 2015/12/16 16:40:07 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.152 2016/07/29 17:12:44 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 | */ |
@@ -374,13 +374,13 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { | |||
374 | int n = cast_int(L->top - func) - 1; /* number of real arguments */ | 374 | int n = cast_int(L->top - func) - 1; /* number of real arguments */ |
375 | int fsize = p->maxstacksize; /* frame size */ | 375 | int fsize = p->maxstacksize; /* frame size */ |
376 | checkstackp(L, fsize, func); | 376 | checkstackp(L, fsize, func); |
377 | if (p->is_vararg != 1) { /* do not use vararg? */ | 377 | if (p->is_vararg) |
378 | base = adjust_varargs(L, p, n); | ||
379 | else { /* non vararg function */ | ||
378 | for (; n < p->numparams; n++) | 380 | for (; n < p->numparams; n++) |
379 | setnilvalue(L->top++); /* complete missing arguments */ | 381 | setnilvalue(L->top++); /* complete missing arguments */ |
380 | base = func + 1; | 382 | base = func + 1; |
381 | } | 383 | } |
382 | else | ||
383 | base = adjust_varargs(L, p, n); | ||
384 | ci = next_ci(L); /* now 'enter' new function */ | 384 | ci = next_ci(L); /* now 'enter' new function */ |
385 | ci->nresults = nresults; | 385 | ci->nresults = nresults; |
386 | ci->func = func; | 386 | ci->func = func; |