mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
new asserts for hooks
This commit is contained in:
parent
48a968e6b5
commit
808525e417
4
ldo.c
4
ldo.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.c,v 1.88 2000/08/29 14:48:16 roberto Exp roberto $
|
** $Id: ldo.c,v 1.89 2000/08/29 14:57:23 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -109,6 +109,7 @@ void luaD_lineHook (lua_State *L, StkId func, int line, lua_Hook linehook) {
|
|||||||
ar.currentline = line;
|
ar.currentline = line;
|
||||||
L->allowhooks = 0; /* cannot call hooks inside a hook */
|
L->allowhooks = 0; /* cannot call hooks inside a hook */
|
||||||
(*linehook)(L, &ar);
|
(*linehook)(L, &ar);
|
||||||
|
LUA_ASSERT(L->allowhooks == 0, "invalid allow");
|
||||||
L->allowhooks = 1;
|
L->allowhooks = 1;
|
||||||
L->top = old_top;
|
L->top = old_top;
|
||||||
L->Cbase = old_Cbase;
|
L->Cbase = old_Cbase;
|
||||||
@ -126,6 +127,7 @@ static void luaD_callHook (lua_State *L, StkId func, lua_Hook callhook,
|
|||||||
ar.event = event;
|
ar.event = event;
|
||||||
L->allowhooks = 0; /* cannot call hooks inside a hook */
|
L->allowhooks = 0; /* cannot call hooks inside a hook */
|
||||||
(*callhook)(L, &ar);
|
(*callhook)(L, &ar);
|
||||||
|
LUA_ASSERT(L->allowhooks == 0, "invalid allow");
|
||||||
L->allowhooks = 1;
|
L->allowhooks = 1;
|
||||||
L->top = old_top;
|
L->top = old_top;
|
||||||
L->Cbase = old_Cbase;
|
L->Cbase = old_Cbase;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user