Skip to content

Commit f71c4c9

Browse files
committed
rb_copy_generic_ivar: handle 0 capacity shapes
1 parent d518d44 commit f71c4c9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

variable.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,6 +2332,12 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
23322332
}
23332333
}
23342334

2335+
if (!shape_to_set_on_dest->capacity) {
2336+
rb_shape_set_shape(dest, shape_to_set_on_dest);
2337+
FL_UNSET(dest, FL_EXIVAR);
2338+
return;
2339+
}
2340+
23352341
new_fields_tbl = gen_fields_tbl_resize(0, shape_to_set_on_dest->capacity);
23362342

23372343
VALUE *src_buf = obj_fields_tbl->as.shape.fields;

0 commit comments

Comments
 (0)