diff options
| -rw-r--r-- | ldo.c | 12 |
1 files changed, 3 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 2.92 2011/02/07 17:14:50 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.93 2011/02/23 13:13:10 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 | */ |
| @@ -299,16 +299,10 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { | |||
| 299 | if (!ttisfunction(func)) /* `func' is not a function? */ | 299 | if (!ttisfunction(func)) /* `func' is not a function? */ |
| 300 | func = tryfuncTM(L, func); /* check the `function' tag method */ | 300 | func = tryfuncTM(L, func); /* check the `function' tag method */ |
| 301 | funcr = savestack(L, func); | 301 | funcr = savestack(L, func); |
| 302 | if (ttislcf(func)) { /* light C function? */ | 302 | if (ttislcf(func) || (cl = clvalue(func), cl->c.isC)) { /* C function? */ |
| 303 | f = fvalue(func); /* get it */ | ||
| 304 | goto isCfunc; /* go to call it */ | ||
| 305 | } | ||
| 306 | cl = clvalue(func); | ||
| 307 | if (cl->c.isC) { /* C closure? */ | ||
| 308 | CallInfo *ci; | 303 | CallInfo *ci; |
| 309 | int n; | 304 | int n; |
| 310 | f = cl->c.f; | 305 | f = (ttislcf(func) ? fvalue(func) : cl->c.f); |
| 311 | isCfunc: /* call C function 'f' */ | ||
| 312 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ | 306 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ |
| 313 | ci = next_ci(L); /* now 'enter' new function */ | 307 | ci = next_ci(L); /* now 'enter' new function */ |
| 314 | ci->nresults = nresults; | 308 | ci->nresults = nresults; |
