From f8ba9a1f605b264069591664eae866b643c74db4 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 10 Jun 2013 07:23:36 +0000 Subject: * 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 --- array.c | 1 + 1 file changed, 1 insertion(+) (limited to 'array.c') 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 */ }); -- cgit v1.2.3