summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-05-15 14:04:36 +0200
committerJean Boussier <[email protected]>2025-05-16 20:16:52 +0200
commitec8900e3eb7f0008a635fb6fbabde3eb7802536b (patch)
tree29c4e3a26a12807e9875c8474da11756664459c7 /object.c
parenta29442701785463d0febf5b8cf217246e927bfae (diff)
rb_gc_impl_copy_finalizer: generate a new object id
Fix a regression introduced by: https://github.com/ruby/ruby/pull/13155
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13350
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object.c b/object.c
index 85b96fe31a..15eeda8689 100644
--- a/object.c
+++ b/object.c
@@ -409,11 +409,11 @@ 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_gc_copy_attributes(dest, obj);
rb_copy_generic_ivar(dest, obj);
if (RB_TYPE_P(obj, T_OBJECT)) {
rb_obj_copy_ivar(dest, obj);
}
+ rb_gc_copy_attributes(dest, obj);
}
static VALUE immutable_obj_clone(VALUE obj, VALUE kwfreeze);