summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--array.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e890a5274f..b8d76773a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Oct 31 18:42:19 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * array.c (ary_partial0): recovers mistakenly feature change at r19723.
+ Array#[m,n] had returned an Array even for an instance of a
+ subclass.
+
Fri Oct 31 12:27:52 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* spec/default.mspec: supports that the build directory != srcdir.
diff --git a/array.c b/array.c
index 46d31ca4c2..732b981b29 100644
--- a/array.c
+++ b/array.c
@@ -604,7 +604,10 @@ ary_make_partial0(VALUE ary, long offset, long len)
assert(offset+len <= RARRAY_LEN(ary));
if (len <= RARRAY_EMBED_LEN_MAX) {
- return rb_ary_new4(len, RARRAY_PTR(ary) + offset);
+ VALUE result = ary_alloc(rb_obj_class(ary));
+ MEMCPY(ARY_EMBED_PTR(result), RARRAY_PTR(ary) + offset, VALUE, len);
+ ARY_SET_EMBED_LEN(result, len);
+ return result;
}
else {
VALUE shared, result = ary_alloc(rb_obj_class(ary));