summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-10 07:23:36 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-10 07:23:36 +0000
commitf8ba9a1f605b264069591664eae866b643c74db4 (patch)
tree5c727ad8b3d414e525ed592edc72e7d58d5090b1 /array.c
parentdd96561f76f8c3ae7d60f5ace40ce32f4f1d73c8 (diff)
* array.c (rb_ary_new_from_values): add assertion
(ary should be young object). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/array.c b/array.c
index 345a60bfc6..7f423ed3bb 100644
--- a/array.c
+++ b/array.c
@@ -456,6 +456,7 @@ rb_ary_new_from_values(long n, const VALUE *elts)
ary = rb_ary_new2(n);
if (n > 0 && elts) {
+ assert(!OBJ_PROMOTED(obj));
RARRAY_PTR_USE(ary, ptr, {
MEMCPY(ptr, elts, VALUE, n); /* new array is not old gen */
});