aboutsummaryrefslogtreecommitdiff
path: root/src/lj_dispatch.c
diff options
context:
space:
mode:
authorMike Pall <mike>2026-02-11 23:12:53 +0100
committerMike Pall <mike>2026-02-11 23:12:53 +0100
commitab834de8b6a963a83046a72b5a7751dcd6cdcff0 (patch)
tree8ef2909de58103cf6e657d1c8b99c81f06fcfbc7 /src/lj_dispatch.c
parenteff4006837792b6105e0a1743283ddde3548fc09 (diff)
downloadluajit-ab834de8b6a963a83046a72b5a7751dcd6cdcff0.tar.gz
luajit-ab834de8b6a963a83046a72b5a7751dcd6cdcff0.tar.bz2
luajit-ab834de8b6a963a83046a72b5a7751dcd6cdcff0.zip
Avoid recording interference due to invocation of VM hooks.
Thanks to Sergey Kaplun. #1429 #1434
Diffstat (limited to 'src/lj_dispatch.c')
-rw-r--r--src/lj_dispatch.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index 1e55c48a..636fb033 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -523,16 +523,18 @@ out:
523/* Stitch a new trace. */ 523/* Stitch a new trace. */
524void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc) 524void LJ_FASTCALL lj_dispatch_stitch(jit_State *J, const BCIns *pc)
525{ 525{
526 ERRNO_SAVE 526 if (!(J2G(J)->hookmask & HOOK_VMEVENT)) {
527 lua_State *L = J->L; 527 ERRNO_SAVE
528 void *cf = cframe_raw(L->cframe); 528 lua_State *L = J->L;
529 const BCIns *oldpc = cframe_pc(cf); 529 void *cf = cframe_raw(L->cframe);
530 setcframe_pc(cf, pc); 530 const BCIns *oldpc = cframe_pc(cf);
531 /* Before dispatch, have to bias PC by 1. */ 531 setcframe_pc(cf, pc);
532 L->top = L->base + cur_topslot(curr_proto(L), pc+1, cframe_multres_n(cf)); 532 /* Before dispatch, have to bias PC by 1. */
533 lj_trace_stitch(J, pc-1); /* Point to the CALL instruction. */ 533 L->top = L->base + cur_topslot(curr_proto(L), pc+1, cframe_multres_n(cf));
534 setcframe_pc(cf, oldpc); 534 lj_trace_stitch(J, pc-1); /* Point to the CALL instruction. */
535 ERRNO_RESTORE 535 setcframe_pc(cf, oldpc);
536 ERRNO_RESTORE
537 }
536} 538}
537#endif 539#endif
538 540