Skip to content

Commit 1e33a45

Browse files
committed
gc: Execute run_final with the lock held
The finalizer table can't be read nor modified without the VM lock.
1 parent ec8900e commit 1e33a45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gc/default/default.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,9 +2857,9 @@ finalize_list(rb_objspace_t *objspace, VALUE zombie)
28572857
next_zombie = RZOMBIE(zombie)->next;
28582858
page = GET_HEAP_PAGE(zombie);
28592859

2860-
run_final(objspace, zombie);
2861-
28622860
int lev = rb_gc_vm_lock();
2861+
2862+
run_final(objspace, zombie);
28632863
{
28642864
GC_ASSERT(BUILTIN_TYPE(zombie) == T_ZOMBIE);
28652865
GC_ASSERT(page->heap->final_slots_count > 0);

0 commit comments

Comments
 (0)