diff options
author | Jean Boussier <[email protected]> | 2025-05-16 16:08:21 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-05-16 20:16:52 +0200 |
commit | 22c09135a8c459dd09f4fb9a6e9124d4a149083b (patch) | |
tree | f18c3747fc5939799cfee6d136676888ea063205 /object.c | |
parent | 1e33a451bbbec1ffa15fc3032a0bdd74bd9b41ff (diff) |
rb_copy_generic_ivar: reset shape_id when no ivar are present
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13350
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -409,10 +409,12 @@ init_copy(VALUE dest, VALUE obj) RBASIC(dest)->flags &= ~(T_MASK|FL_EXIVAR); // Copies the shape id from obj to dest RBASIC(dest)->flags |= RBASIC(obj)->flags & (T_MASK|FL_EXIVAR); - rb_copy_generic_ivar(dest, obj); if (RB_TYPE_P(obj, T_OBJECT)) { rb_obj_copy_ivar(dest, obj); } + else { + rb_copy_generic_ivar(dest, obj); + } rb_gc_copy_attributes(dest, obj); } |