From 568794956025183fc9a9b79e0c818a885e3d0aeb Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 4 Feb 1999 15:47:59 -0200 Subject: "lua_debug", "lua_callhook" and "lua_linehook" must be inside "lua_state". --- ldo.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ldo.c') diff --git a/ldo.c b/ldo.c index 4e895c0a..16f79c51 100644 --- a/ldo.c +++ b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 1.29 1998/08/21 17:43:44 roberto Exp $ +** $Id: ldo.c,v 1.30 1999/01/15 11:38:33 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -94,7 +94,7 @@ void luaD_lineHook (int line) struct C_Lua_Stack oldCLS = L->Cstack; StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack; L->Cstack.num = 0; - (*lua_linehook)(line); + (*L->linehook)(line); L->stack.top = L->stack.stack+old_top; L->Cstack = oldCLS; } @@ -106,13 +106,13 @@ void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn) StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack; L->Cstack.num = 0; if (isreturn) - (*lua_callhook)(LUA_NOOBJECT, "(return)", 0); + (*L->callhook)(LUA_NOOBJECT, "(return)", 0); else { TObject *f = L->stack.stack+base-1; if (tf) - (*lua_callhook)(Ref(f), tf->fileName->str, tf->lineDefined); + (*L->callhook)(Ref(f), tf->fileName->str, tf->lineDefined); else - (*lua_callhook)(Ref(f), "(C)", -1); + (*L->callhook)(Ref(f), "(C)", -1); } L->stack.top = L->stack.stack+old_top; L->Cstack = oldCLS; @@ -133,10 +133,10 @@ static StkId callC (lua_CFunction f, StkId base) CS->num = numarg; CS->lua2C = base; CS->base = base+numarg; /* == top-stack */ - if (lua_callhook) + if (L->callhook) luaD_callHook(base, NULL, 0); (*f)(); /* do the actual call */ - if (lua_callhook) /* func may have changed lua_callhook */ + if (L->callhook) /* func may have changed lua_callhook */ luaD_callHook(base, NULL, 1); firstResult = CS->base; *CS = oldCLS; -- cgit v1.2.3-55-g6feb