summaryrefslogtreecommitdiff
path: root/lib/lua/src/ldo.c
diff options
context:
space:
mode:
authorpixel <pixel>2004-12-27 22:18:52 +0000
committerpixel <pixel>2004-12-27 22:18:52 +0000
commit4710572bf3f2fb202d0cb3dda95ef28c85ea1b81 (patch)
treebadd157b2b2c3f18553c793f49f1294dc0637372 /lib/lua/src/ldo.c
parentecb5155dfed400c50b3b54a758d546b7754bcbf1 (diff)
adding C-closure wrapping to lua, and using it.
Diffstat (limited to 'lib/lua/src/ldo.c')
-rw-r--r--lib/lua/src/ldo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/lua/src/ldo.c b/lib/lua/src/ldo.c
index 082b9e6..b23f8b1 100644
--- a/lib/lua/src/ldo.c
+++ b/lib/lua/src/ldo.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldo.c,v 1.7 2004-12-27 19:59:05 pixel Exp $
+** $Id: ldo.c,v 1.8 2004-12-27 22:18:53 pixel Exp $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -257,7 +257,11 @@ StkId luaD_precall (lua_State *L, StkId func) {
#ifdef LUA_COMPATUPVALUES
lua_pushupvalues(L);
#endif
- n = (*clvalue(L->base - 1)->c.f)(L); /* do the actual call */
+ if (L->callwrap) {
+ n = L->callwrap(L, clvalue(L->base - 1)->c.f); /* wrap the call */
+ } else {
+ n = (*clvalue(L->base - 1)->c.f)(L); /* do the actual call */
+ }
lua_lock(L);
return L->top - n;
}