diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.260 2002/11/07 15:37:10 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.261 2002/11/14 16:15:53 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -70,7 +70,7 @@ int luaV_tostring (lua_State *L, StkId obj) { | |||
70 | 70 | ||
71 | 71 | ||
72 | static void traceexec (lua_State *L) { | 72 | static void traceexec (lua_State *L) { |
73 | unsigned long mask = L->hookmask; | 73 | lu_byte mask = L->hookmask; |
74 | if (mask > LUA_MASKLINE) { /* instruction-hook set? */ | 74 | if (mask > LUA_MASKLINE) { /* instruction-hook set? */ |
75 | if (L->hookcount == 0) { | 75 | if (L->hookcount == 0) { |
76 | luaD_callhook(L, LUA_HOOKCOUNT, -1); | 76 | luaD_callhook(L, LUA_HOOKCOUNT, -1); |
@@ -82,6 +82,10 @@ static void traceexec (lua_State *L) { | |||
82 | CallInfo *ci = L->ci; | 82 | CallInfo *ci = L->ci; |
83 | Proto *p = ci_func(ci)->l.p; | 83 | Proto *p = ci_func(ci)->l.p; |
84 | int newline = getline(p, pcRel(*ci->u.l.pc, p)); | 84 | int newline = getline(p, pcRel(*ci->u.l.pc, p)); |
85 | if (!L->hookinit) { | ||
86 | luaG_inithooks(L); | ||
87 | return; | ||
88 | } | ||
85 | lua_assert(ci->state & CI_HASFRAME); | 89 | lua_assert(ci->state & CI_HASFRAME); |
86 | if (pcRel(*ci->u.l.pc, p) == 0) /* tracing may be starting now? */ | 90 | if (pcRel(*ci->u.l.pc, p) == 0) /* tracing may be starting now? */ |
87 | ci->u.l.savedpc = *ci->u.l.pc; /* initialize `savedpc' */ | 91 | ci->u.l.savedpc = *ci->u.l.pc; /* initialize `savedpc' */ |