aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ldo.c b/ldo.c
index 37dac3b5..3e0053f4 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.165 2002/03/20 12:52:32 roberto Exp roberto $ 2** $Id: ldo.c,v 1.166 2002/03/25 17:47:14 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*/
@@ -109,15 +109,16 @@ static void luaD_openstack (lua_State *L, StkId pos) {
109 109
110static void dohook (lua_State *L, lua_Debug *ar, lua_Hook hook) { 110static void dohook (lua_State *L, lua_Debug *ar, lua_Hook hook) {
111 ptrdiff_t top = savestack(L, L->top); 111 ptrdiff_t top = savestack(L, L->top);
112 ptrdiff_t ci_top = savestack(L, L->ci->top);
112 luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ 113 luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */
113 L->ci->top += LUA_MINSTACK; 114 L->ci->top = L->top + LUA_MINSTACK;
114 L->allowhooks = 0; /* cannot call hooks inside a hook */ 115 L->allowhooks = 0; /* cannot call hooks inside a hook */
115 lua_unlock(L); 116 lua_unlock(L);
116 (*hook)(L, ar); 117 (*hook)(L, ar);
117 lua_lock(L); 118 lua_lock(L);
118 lua_assert(L->allowhooks == 0); 119 lua_assert(L->allowhooks == 0);
119 L->allowhooks = 1; 120 L->allowhooks = 1;
120 L->ci->top -= LUA_MINSTACK; 121 L->ci->top = restorestack(L, ci_top);
121 L->top = restorestack(L, top); 122 L->top = restorestack(L, top);
122} 123}
123 124