summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-02 04:25:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-10-02 04:25:53 +0000
commit3ab5d775b737f681225864200c893b68b7b8f546 (patch)
treea7d8d79fba4dd4bf11bcd80d66ab41679049fec3 /array.c
parente431908527e19099572492a08742c9529f3d32ab (diff)
* ext/socket/socket.c (unix_addr): getsockname(2) may result len = 0.
* ext/socket/socket.c (unix_peeraddr): getpeername(2) may result len = 0. * eval.c (POP_BLOCK): rb_gc_force_recycle() was called too much. Should not be called if SCOPE_DONT_RECYCLE is set. * string.c (rb_str_substr): should return an instance of receiver's class. * string.c (rb_str_succ): ditto. * array.c (rb_ary_subseq): ditto. * string.c (rb_str_reverse): should return an instance of reciever's class. * string.c (rb_str_times): ditto. * array.c (rb_ary_times): ditto * string.c (str_gsub): ditto. * string.c (rb_str_ljust): ditto. * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/array.c b/array.c
index 724cdbb66b..9e15e5209a 100644
--- a/array.c
+++ b/array.c
@@ -414,6 +414,7 @@ rb_ary_subseq(ary, beg, len)
ary2 = rb_ary_new2(len);
MEMCPY(RARRAY(ary2)->ptr, RARRAY(ary)->ptr+beg, VALUE, len);
RARRAY(ary2)->len = len;
+ RBASIC(ary2)->klass = rb_obj_class(ary);
return ary2;
}
@@ -1296,6 +1297,9 @@ rb_ary_times(ary, times)
MEMCPY(RARRAY(ary2)->ptr+i, RARRAY(ary)->ptr, VALUE, RARRAY(ary)->len);
}
+ OBJ_INFECT(ary2, ary);
+ RBASIC(ary2)->klass = rb_obj_class(ary);
+
return ary2;
}