diff --git a/object.c b/object.c index 4d54b73740..28e6125421 100644 --- a/object.c +++ b/object.c @@ -337,12 +337,10 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj) return; } - shape_id_t dest_shape_id = src_shape_id; shape_id_t initial_shape_id = RBASIC_SHAPE_ID(dest); - RUBY_ASSERT(RSHAPE_TYPE_P(initial_shape_id, SHAPE_ROOT)); - dest_shape_id = rb_shape_rebuild(initial_shape_id, src_shape_id); + shape_id_t dest_shape_id = rb_shape_rebuild(initial_shape_id, src_shape_id); if (UNLIKELY(rb_shape_too_complex_p(dest_shape_id))) { st_table *table = rb_st_init_numtable_with_size(src_num_ivs); rb_obj_copy_ivs_to_hash_table(obj, table);