diff options
-rw-r--r-- | ldebug.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.114 2015/03/28 19:14:47 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.115 2015/05/22 17:45:56 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 | */ |
@@ -640,9 +640,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { | |||
640 | void luaG_traceexec (lua_State *L) { | 640 | void luaG_traceexec (lua_State *L) { |
641 | CallInfo *ci = L->ci; | 641 | CallInfo *ci = L->ci; |
642 | lu_byte mask = L->hookmask; | 642 | lu_byte mask = L->hookmask; |
643 | int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); | 643 | int counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); |
644 | if (counthook) | 644 | if (counthook) |
645 | resethookcount(L); /* reset count */ | 645 | resethookcount(L); /* reset count */ |
646 | else if (!(mask & LUA_MASKLINE)) | ||
647 | return; /* no line hook and count != 0; nothing to be done */ | ||
646 | if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ | 648 | if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ |
647 | ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ | 649 | ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ |
648 | return; /* do not call hook again (VM yielded, so it did not move) */ | 650 | return; /* do not call hook again (VM yielded, so it did not move) */ |