summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--array.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index cfa44fb..be38ae4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,12 @@ Tue Sep 26 15:31:26 2006 NAKAMURA Usaku <usa@ruby-lang.org>
* {win32,wince}/Makefile.sub (CPP): check predefined value.
+Tue Sep 26 07:55:16 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * array.c (rb_ary_shift): should not move memory region if array
+ body is shared. a patch from Kent Sibilev <ksruby at gmail.com>.
+ [ruby-core:08922]
+
Mon Sep 25 22:26:26 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_path_end): skip root directory. fixed: [ruby-core:08913]
diff --git a/array.c b/array.c
index 6df82f7..2e9d927 100644
--- a/array.c
+++ b/array.c
@@ -501,7 +501,7 @@ rb_ary_shift(ary)
rb_ary_modify_check(ary);
if (RARRAY(ary)->len == 0) return Qnil;
top = RARRAY(ary)->ptr[0];
- if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE) {
+ if (RARRAY_LEN(ary) < ARY_DEFAULT_SIZE && !FL_TEST(ary, ELTS_SHARED)) {
MEMMOVE(RARRAY_PTR(ary), RARRAY_PTR(ary)+1, VALUE, RARRAY_LEN(ary));
}
else {