diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-07 16:13:49 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-07 16:13:49 -0200 |
commit | 7178a5e34aa56c09a01a6664bb7a61c6771700d4 (patch) | |
tree | 318a1dd14cd5a0497229183e56e29198b3b2016c /ldo.c | |
parent | 322b7b5fc55da0d166efc693cfe674220190b010 (diff) | |
download | lua-7178a5e34aa56c09a01a6664bb7a61c6771700d4.tar.gz lua-7178a5e34aa56c09a01a6664bb7a61c6771700d4.tar.bz2 lua-7178a5e34aa56c09a01a6664bb7a61c6771700d4.zip |
new way to handle top x L->top
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.121 2001/02/02 15:13:05 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.122 2001/02/02 16:23:20 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 | */ |
@@ -143,14 +143,6 @@ static StkId callCclosure (lua_State *L, const struct Closure *cl, StkId base) { | |||
143 | } | 143 | } |
144 | 144 | ||
145 | 145 | ||
146 | void luaD_callTM (lua_State *L, Closure *f, int nParams, int nResults) { | ||
147 | StkId base = L->top - nParams; | ||
148 | luaD_openstack(L, base); | ||
149 | setclvalue(base, f); | ||
150 | luaD_call(L, base, nResults); | ||
151 | } | ||
152 | |||
153 | |||
154 | /* | 146 | /* |
155 | ** Call a function (C or Lua). The function to be called is at *func. | 147 | ** Call a function (C or Lua). The function to be called is at *func. |
156 | ** The arguments are on the stack, right after the function. | 148 | ** The arguments are on the stack, right after the function. |
@@ -182,6 +174,7 @@ void luaD_call (lua_State *L, StkId func, int nResults) { | |||
182 | if (callhook) /* same hook that was active at entry */ | 174 | if (callhook) /* same hook that was active at entry */ |
183 | luaD_callHook(L, func, callhook, "return"); | 175 | luaD_callHook(L, func, callhook, "return"); |
184 | lua_assert(ttype(func) == LUA_TMARK); | 176 | lua_assert(ttype(func) == LUA_TMARK); |
177 | setnilvalue(func); /* remove callinfo from the stack */ | ||
185 | /* move results to `func' (to erase parameters and function) */ | 178 | /* move results to `func' (to erase parameters and function) */ |
186 | if (nResults == LUA_MULTRET) { | 179 | if (nResults == LUA_MULTRET) { |
187 | while (firstResult < L->top) /* copy all results */ | 180 | while (firstResult < L->top) /* copy all results */ |