From 10788166e7e568fdcd0b748e8d5dab442dcdc7ef Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 17 Nov 2022 15:57:11 -0800 Subject: Differentiate T_OBJECT shapes from other objects We would like to differentiate types of objects via their shape. This commit adds a special T_OBJECT shape when we allocate an instance of T_OBJECT. This allows us to avoid testing whether an object is an instance of a T_OBJECT or not, we can just check the shape. --- object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'object.c') diff --git a/object.c b/object.c index 7f4404c462..e50430a4fb 100644 --- a/object.c +++ b/object.c @@ -293,7 +293,7 @@ rb_obj_copy_ivar(VALUE dest, VALUE obj) rb_shape_t * initial_shape = rb_shape_get_shape(dest); if (initial_shape->size_pool_index != src_shape->size_pool_index) { - RUBY_ASSERT(initial_shape->parent_id == ROOT_SHAPE_ID || initial_shape->type == SHAPE_ROOT); + RUBY_ASSERT(initial_shape->type == SHAPE_T_OBJECT); shape_to_set_on_dest = rb_shape_rebuild_shape(initial_shape, src_shape); } -- cgit v1.2.1