aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2026-03-27 20:04:50 +0100
committerMike Pall <mike>2026-03-27 20:04:50 +0100
commitfbb36bb6bfa88716a47c58bcf9ce9f2ef752abac (patch)
tree2b8b6e9dd1c9db7d1473d4b6dc8e225321d59fd4 /src
parent6594f87327f80c28461e9f2b04a694dfb6191299 (diff)
downloadluajit-fbb36bb6bfa88716a47c58bcf9ce9f2ef752abac.tar.gz
luajit-fbb36bb6bfa88716a47c58bcf9ce9f2ef752abac.tar.bz2
luajit-fbb36bb6bfa88716a47c58bcf9ce9f2ef752abac.zip
Fix VM event error handling for finalizers.
Reported by Sergey Kaplun. #1445
Diffstat (limited to '')
-rw-r--r--src/lj_gc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index 08972dc5..1fed0b54 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -525,10 +525,12 @@ static void gc_call_finalizer(global_State *g, lua_State *L,
525 if (LJ_HASPROFILE && (oldh & HOOK_PROFILE)) lj_dispatch_update(g); 525 if (LJ_HASPROFILE && (oldh & HOOK_PROFILE)) lj_dispatch_update(g);
526 g->gc.threshold = oldt; /* Restore GC threshold. */ 526 g->gc.threshold = oldt; /* Restore GC threshold. */
527 if (errcode) { 527 if (errcode) {
528 TValue tmp;
529 copyTV(VL, &tmp, VL->top-1);
530 VL->top--;
528 lj_vmevent_send(g, ERRFIN, 531 lj_vmevent_send(g, ERRFIN,
529 copyTV(V, V->top++, L->top-1); 532 copyTV(V, V->top++, &tmp);
530 ); 533 );
531 L->top--;
532 } 534 }
533} 535}
534 536