mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Refactor rb_imemo_fields_new
to not assume T_CLASS
This commit is contained in:
parent
fb68721f63
commit
164486a954
Notes:
git
2025-06-17 13:28:18 +00:00
3 changed files with 6 additions and 6 deletions
|
@ -526,7 +526,7 @@ RCLASS_WRITABLE_ENSURE_FIELDS_OBJ(VALUE obj)
|
|||
RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
|
||||
rb_classext_t *ext = RCLASS_EXT_WRITABLE(obj);
|
||||
if (!ext->fields_obj) {
|
||||
RB_OBJ_WRITE(obj, &ext->fields_obj, rb_imemo_fields_new(obj, 1));
|
||||
RB_OBJ_WRITE(obj, &ext->fields_obj, rb_imemo_fields_new(rb_singleton_class(obj), 1));
|
||||
}
|
||||
return ext->fields_obj;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue