diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-29 16:01:34 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-08-29 16:01:34 -0300 |
| commit | 808525e4173d9f8ec1d1f2665cb4d551d0f4075b (patch) | |
| tree | 7d3f19a59cf18c6cbce6ab050bda964684ad4565 | |
| parent | 48a968e6b5c8ada1b8429f813f82e1ed0c544e53 (diff) | |
| download | lua-808525e4173d9f8ec1d1f2665cb4d551d0f4075b.tar.gz lua-808525e4173d9f8ec1d1f2665cb4d551d0f4075b.tar.bz2 lua-808525e4173d9f8ec1d1f2665cb4d551d0f4075b.zip | |
new asserts for hooks
| -rw-r--r-- | ldo.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.88 2000/08/29 14:48:16 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.89 2000/08/29 14:57:23 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,6 +109,7 @@ void luaD_lineHook (lua_State *L, StkId func, int line, lua_Hook linehook) { | |||
| 109 | ar.currentline = line; | 109 | ar.currentline = line; |
| 110 | L->allowhooks = 0; /* cannot call hooks inside a hook */ | 110 | L->allowhooks = 0; /* cannot call hooks inside a hook */ |
| 111 | (*linehook)(L, &ar); | 111 | (*linehook)(L, &ar); |
| 112 | LUA_ASSERT(L->allowhooks == 0, "invalid allow"); | ||
| 112 | L->allowhooks = 1; | 113 | L->allowhooks = 1; |
| 113 | L->top = old_top; | 114 | L->top = old_top; |
| 114 | L->Cbase = old_Cbase; | 115 | L->Cbase = old_Cbase; |
| @@ -126,6 +127,7 @@ static void luaD_callHook (lua_State *L, StkId func, lua_Hook callhook, | |||
| 126 | ar.event = event; | 127 | ar.event = event; |
| 127 | L->allowhooks = 0; /* cannot call hooks inside a hook */ | 128 | L->allowhooks = 0; /* cannot call hooks inside a hook */ |
| 128 | (*callhook)(L, &ar); | 129 | (*callhook)(L, &ar); |
| 130 | LUA_ASSERT(L->allowhooks == 0, "invalid allow"); | ||
| 129 | L->allowhooks = 1; | 131 | L->allowhooks = 1; |
| 130 | L->top = old_top; | 132 | L->top = old_top; |
| 131 | L->Cbase = old_Cbase; | 133 | L->Cbase = old_Cbase; |
