diff options
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.45 2009/03/26 12:56:38 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.46 2009/04/17 14:28:06 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -35,9 +35,7 @@ static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); | |||
35 | 35 | ||
36 | static int currentpc (lua_State *L, CallInfo *ci) { | 36 | static int currentpc (lua_State *L, CallInfo *ci) { |
37 | if (!isLua(ci)) return -1; /* function is not a Lua function? */ | 37 | if (!isLua(ci)) return -1; /* function is not a Lua function? */ |
38 | if (ci == L->ci) | 38 | return pcRel(ci->u.l.savedpc, ci_func(ci)->l.p); |
39 | ci->savedpc = L->savedpc; | ||
40 | return pcRel(ci->savedpc, ci_func(ci)->l.p); | ||
41 | } | 39 | } |
42 | 40 | ||
43 | 41 | ||
@@ -58,7 +56,7 @@ LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { | |||
58 | mask = 0; | 56 | mask = 0; |
59 | func = NULL; | 57 | func = NULL; |
60 | } | 58 | } |
61 | L->oldpc = L->savedpc; | 59 | L->oldpc = NULL; |
62 | L->hook = func; | 60 | L->hook = func; |
63 | L->basehookcount = count; | 61 | L->basehookcount = count; |
64 | resethookcount(L); | 62 | resethookcount(L); |