From 4710572bf3f2fb202d0cb3dda95ef28c85ea1b81 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 27 Dec 2004 22:18:52 +0000 Subject: adding C-closure wrapping to lua, and using it. --- lib/lua/src/ldo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/lua/src/ldo.c') 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; } -- cgit v1.2.3