aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ldebug.c b/ldebug.c
index 8b4bd546..aa3277cb 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -927,12 +927,12 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) {
927 } 927 }
928 pc++; /* reference is always next instruction */ 928 pc++; /* reference is always next instruction */
929 ci->u.l.savedpc = pc; /* save 'pc' */ 929 ci->u.l.savedpc = pc; /* save 'pc' */
930 counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); 930 counthook = (mask & LUA_MASKCOUNT) && (--L->hookcount == 0);
931 if (counthook) 931 if (counthook)
932 resethookcount(L); /* reset count */ 932 resethookcount(L); /* reset count */
933 else if (!(mask & LUA_MASKLINE)) 933 else if (!(mask & LUA_MASKLINE))
934 return 1; /* no line hook and count != 0; nothing to be done now */ 934 return 1; /* no line hook and count != 0; nothing to be done now */
935 if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ 935 if (ci->callstatus & CIST_HOOKYIELD) { /* hook yielded last time? */
936 ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ 936 ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */
937 return 1; /* do not call hook again (VM yielded, so it did not move) */ 937 return 1; /* do not call hook again (VM yielded, so it did not move) */
938 } 938 }
@@ -954,7 +954,6 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) {
954 if (L->status == LUA_YIELD) { /* did hook yield? */ 954 if (L->status == LUA_YIELD) { /* did hook yield? */
955 if (counthook) 955 if (counthook)
956 L->hookcount = 1; /* undo decrement to zero */ 956 L->hookcount = 1; /* undo decrement to zero */
957 ci->u.l.savedpc--; /* undo increment (resume will increment it again) */
958 ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ 957 ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */
959 luaD_throw(L, LUA_YIELD); 958 luaD_throw(L, LUA_YIELD);
960 } 959 }