Skip to content

Commit 50c6bd4

Browse files
Satoshi Tagomoritagomoris
authored andcommitted
Update vm->self location and mark it in vm.c for consistency
1 parent b1410c1 commit 50c6bd4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

gc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,6 @@ rb_gc_mark_roots(void *objspace, const char **categoryp)
30603060

30613061
MARK_CHECKPOINT("vm");
30623062
rb_vm_mark(vm);
3063-
if (vm->self) gc_mark_internal(vm->self);
30643063

30653064
MARK_CHECKPOINT("end_proc");
30663065
rb_mark_end_proc();

vm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,6 +2982,7 @@ rb_vm_update_references(void *ptr)
29822982
if (ptr) {
29832983
rb_vm_t *vm = ptr;
29842984

2985+
vm->self = rb_gc_location(vm->self);
29852986
vm->mark_object_ary = rb_gc_location(vm->mark_object_ary);
29862987
vm->load_path = rb_gc_location(vm->load_path);
29872988
vm->load_path_snapshot = rb_gc_location(vm->load_path_snapshot);
@@ -3068,6 +3069,8 @@ rb_vm_mark(void *ptr)
30683069
rb_gc_mark_maybe(*list->varptr);
30693070
}
30703071

3072+
rb_gc_mark_movable(vm->self);
3073+
30713074
if (vm->main_namespace) {
30723075
rb_namespace_entry_mark((void *)vm->main_namespace);
30733076
}

0 commit comments

Comments
 (0)