aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-01-25 13:52:52 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-01-25 13:52:52 -0300
commit108e0bdc8495782544c351b17eaae1411a910e89 (patch)
tree1196b9d9288b38b0be0290e30ec818fa09d06238 /ldebug.c
parentb34a97a4af5c9e973915c07dba918d95009e0acd (diff)
parente288c5a91883793d14ed9e9d93464f6ee0b08915 (diff)
downloadlua-108e0bdc8495782544c351b17eaae1411a910e89.tar.gz
lua-108e0bdc8495782544c351b17eaae1411a910e89.tar.bz2
lua-108e0bdc8495782544c351b17eaae1411a910e89.zip
Merge branch 'master' into nextversion
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 }