Unshift pointer move size was wrong (not len but alen); fix #3780

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-08-19 11:08:46 +09:00
parent 29ad0a7964
commit 8b3298b2d6
+1 -1
View File
@@ -570,7 +570,7 @@ mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
&& a->as.heap.aux.shared->refcnt == 1 /* shared only referenced from this array */
&& a->as.heap.ptr - a->as.heap.aux.shared->ptr >= alen) /* there's room for unshifted item */ {
ary_modify_check(mrb, a);
a->as.heap.ptr -= len;
a->as.heap.ptr -= alen;
ptr = a->as.heap.ptr;
}
else {