Skip to content

Commit fbe6e93

Browse files
committed
rb_copy_generic_ivar: handle 0 capacity shapes
1 parent bb218f9 commit fbe6e93

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
@@ -2331,6 +2331,12 @@ rb_copy_generic_ivar(VALUE dest, VALUE obj)
23312331
}
23322332
}
23332333

2334+
if (!shape_to_set_on_dest->capacity) {
2335+
rb_shape_set_shape(dest, shape_to_set_on_dest);
2336+
FL_UNSET(dest, FL_EXIVAR);
2337+
return;
2338+
}
2339+
23342340
new_ivtbl = gen_ivtbl_resize(0, shape_to_set_on_dest->capacity);
23352341

23362342
VALUE *src_buf = obj_ivtbl->as.shape.ivptr;

0 commit comments

Comments
 (0)