diff options
author | Jean Boussier <[email protected]> | 2025-06-04 13:35:43 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-06-05 22:06:15 +0200 |
commit | 4e39580992064a4e91e9b8626a1a220f262a7011 () | |
tree | 283baa3f6d9bdac213a6f6b44a12580d7a2f6b84 /vm_insnhelper.c | |
parent | 0b07d2a1e32a456fc302c8d970fa85782bdb98ce (diff) |
Refactor raw accesses to rb_shape_t.capacity
Notes: Merged: https://.com/ruby/ruby/pull/13524
-rw-r--r-- | vm_insnhelper.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -1455,11 +1455,10 @@ vm_setivar_default(VALUE obj, ID id, VALUE val, shape_id_t dest_shape_id, attr_i RUBY_ASSERT(dest_shape_id != INVALID_SHAPE_ID && shape_id != INVALID_SHAPE_ID); } else if (dest_shape_id != INVALID_SHAPE_ID) { - rb_shape_t *shape = RSHAPE(shape_id); rb_shape_t *dest_shape = RSHAPE(dest_shape_id); - if (shape_id == dest_shape->parent_id && dest_shape->edge_name == id && shape->capacity == dest_shape->capacity) { - RUBY_ASSERT(index < dest_shape->capacity); } else { return Qundef; @@ -1499,17 +1498,16 @@ vm_setivar(VALUE obj, ID id, VALUE val, shape_id_t dest_shape_id, attr_index_t i VM_ASSERT(!rb_ractor_shareable_p(obj)); } else if (dest_shape_id != INVALID_SHAPE_ID) { - rb_shape_t *shape = RSHAPE(shape_id); rb_shape_t *dest_shape = RSHAPE(dest_shape_id); shape_id_t source_shape_id = dest_shape->parent_id; - if (shape_id == source_shape_id && dest_shape->edge_name == id && shape->capacity == dest_shape->capacity) { RUBY_ASSERT(dest_shape_id != INVALID_SHAPE_ID && shape_id != INVALID_SHAPE_ID); RBASIC_SET_SHAPE_ID(obj, dest_shape_id); RUBY_ASSERT(rb_shape_get_next_iv_shape(source_shape_id, id) == dest_shape_id); - RUBY_ASSERT(index < dest_shape->capacity); } else { break; |