diff options
Diffstat (limited to 'ldblib.c')
| -rw-r--r-- | ldblib.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldblib.c,v 1.58 2002/06/18 15:17:58 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.59 2002/06/18 17:10:43 roberto Exp roberto $ |
| 3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -126,12 +126,17 @@ static void hookf (lua_State *L, void *key) { | |||
| 126 | 126 | ||
| 127 | static void callf (lua_State *L, lua_Debug *ar) { | 127 | static void callf (lua_State *L, lua_Debug *ar) { |
| 128 | lua_pushstring(L, ar->event); | 128 | lua_pushstring(L, ar->event); |
| 129 | lua_assert(lua_getinfo(L, "lS", ar) && ar->currentline == -1); | ||
| 129 | hookf(L, (void *)&KEY_CALLHOOK); | 130 | hookf(L, (void *)&KEY_CALLHOOK); |
| 130 | } | 131 | } |
| 131 | 132 | ||
| 132 | 133 | ||
| 133 | static void linef (lua_State *L, lua_Debug *ar) { | 134 | static void linef (lua_State *L, lua_Debug *ar) { |
| 134 | lua_pushnumber(L, ar->currentline); | 135 | lua_pushnumber(L, ar->currentline); |
| 136 | lua_assert((ar->currentline = ar->linedefined = -1, | ||
| 137 | lua_getinfo(L, "lS", ar) && | ||
| 138 | ar->currentline == lua_tonumber(L, -1) && | ||
| 139 | ar->linedefined >= 0)); | ||
| 135 | hookf(L, (void *)&KEY_LINEHOOK); | 140 | hookf(L, (void *)&KEY_LINEHOOK); |
| 136 | } | 141 | } |
| 137 | 142 | ||
