From ee5ef0f295a317457132912c817d0ad9ee74e8af Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 22 Oct 2015 12:40:47 -0200 Subject: hook test in 'luaV_execute' reduced to minimum (rest done in 'luaG_traceexec' --- ldebug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ldebug.c b/ldebug.c index 91c3e5b7..211806bb 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.114 2015/03/28 19:14:47 roberto Exp roberto $ +** $Id: ldebug.c,v 2.115 2015/05/22 17:45:56 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -640,9 +640,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { void luaG_traceexec (lua_State *L) { CallInfo *ci = L->ci; lu_byte mask = L->hookmask; - int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); + int counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); if (counthook) resethookcount(L); /* reset count */ + else if (!(mask & LUA_MASKLINE)) + return; /* no line hook and count != 0; nothing to be done */ if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ return; /* do not call hook again (VM yielded, so it did not move) */ -- cgit v1.2.3-55-g6feb