summaryrefslogtreecommitdiffhomepage
path: root/src/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/array.c')
-rw-r--r--src/array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/array.c b/src/array.c
index f3d29faec..2e8cf1116 100644
--- a/src/array.c
+++ b/src/array.c
@@ -533,6 +533,7 @@ mrb_ary_unshift_m(mrb_state *mrb, mrb_value self)
if (ARY_SHARED_P(a)
&& a->aux.shared->refcnt == 1 /* shared only referenced from this array */
&& a->ptr - a->aux.shared->ptr >= len) /* there's room for unshifted item */ {
+ ary_modify_check(mrb, a);
a->ptr -= len;
}
else {