aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/ldo.c b/ldo.c
index 24f4a169..39ef5626 100644
--- a/ldo.c
+++ b/ldo.c
@@ -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
146void 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 */