Skip to content

Commit

Permalink
Register classpath of FrozenCore before converting to ICLASS
Browse files Browse the repository at this point in the history
Since ICLASS do not mark the classpath, we need to register it as a
global object before we convert RubyVM::FrozenCore as a ICLASS.
  • Loading branch information
peterzhu2118 committed Mar 27, 2024
1 parent 9ad175c commit 1d99fe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vm.c
Expand Up @@ -3908,6 +3908,7 @@ Init_VM(void)
/* FrozenCore (hidden) */
fcore = rb_class_new(rb_cBasicObject);
rb_set_class_path(fcore, rb_cRubyVM, "FrozenCore");
rb_vm_register_global_object(rb_class_path_cached(fcore));
RBASIC(fcore)->flags = T_ICLASS;
klass = rb_singleton_class(fcore);
rb_define_method_id(klass, id_core_set_method_alias, m_core_set_method_alias, 3);
Expand All @@ -3927,7 +3928,6 @@ Init_VM(void)
RBASIC_CLEAR_CLASS(klass);
rb_obj_freeze(klass);
rb_vm_register_global_object(fcore);
rb_vm_register_global_object(rb_class_path_cached(fcore));
rb_mRubyVMFrozenCore = fcore;

/*
Expand Down

0 comments on commit 1d99fe4

Please sign in to comment.