aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-22 12:40:47 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-22 12:40:47 -0200
commitee5ef0f295a317457132912c817d0ad9ee74e8af (patch)
tree8a1bca2ea857de6782f451a778ae12a1e8fc3b9a
parent5bdee4f81057698cf7da2bb5da814984170abf8c (diff)
downloadlua-ee5ef0f295a317457132912c817d0ad9ee74e8af.tar.gz
lua-ee5ef0f295a317457132912c817d0ad9ee74e8af.tar.bz2
lua-ee5ef0f295a317457132912c817d0ad9ee74e8af.zip
hook test in 'luaV_execute' reduced to minimum (rest done in
'luaG_traceexec'
-rw-r--r--ldebug.c6
1 files 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 @@
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, ...) {
640void luaG_traceexec (lua_State *L) { 640void 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) */