mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Handle SHAPE_TOO_COMPLEX in generic_ivar_set
This commit is contained in:
parent
4aacc559d9
commit
ac7f913ca3
2 changed files with 25 additions and 0 deletions
|
@ -1484,6 +1484,11 @@ generic_ivar_set(VALUE obj, ID id, VALUE val)
|
|||
attr_index_t index;
|
||||
// The returned shape will have `id` in its iv_table
|
||||
rb_shape_t *shape = rb_shape_get_shape(obj);
|
||||
if (UNLIKELY(shape->type == SHAPE_OBJ_TOO_COMPLEX)) {
|
||||
rb_complex_ivar_set(obj, id, val);
|
||||
return;
|
||||
}
|
||||
|
||||
bool found = rb_shape_get_iv_index(shape, id, &index);
|
||||
rb_shape_t *next_shape = shape;
|
||||
if (!found) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue