Use the shape_id rather than FL_EXIVAR

We still keep setting `FL_EXIVAR` so that `rb_shape_verify_consistency`
can detect discrepancies.
This commit is contained in:
Jean Boussier 2025-06-13 15:49:17 +02:00
parent b51078f82e
commit 6dbe24fe56
Notes: git 2025-06-13 21:50:44 +00:00
9 changed files with 54 additions and 51 deletions

View file

@ -373,9 +373,9 @@ init_copy(VALUE dest, VALUE obj)
if (OBJ_FROZEN(dest)) {
rb_raise(rb_eTypeError, "[bug] frozen object (%s) allocated", rb_obj_classname(dest));
}
RBASIC(dest)->flags &= ~(T_MASK|FL_EXIVAR);
RBASIC(dest)->flags &= ~T_MASK;
// Copies the shape id from obj to dest
RBASIC(dest)->flags |= RBASIC(obj)->flags & (T_MASK|FL_EXIVAR);
RBASIC(dest)->flags |= RBASIC(obj)->flags & T_MASK;
switch (BUILTIN_TYPE(obj)) {
case T_IMEMO:
rb_bug("Unreacheable");