зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
dd96561f76
Коммит
f8ba9a1f60
|
@ -1,3 +1,8 @@
|
|||
Mon Jun 10 16:22:50 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* array.c (rb_ary_new_from_values): add assertion
|
||||
(ary should be young object).
|
||||
|
||||
Mon Jun 10 16:05:59 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (wmap_mark): check allocation of `w->obj2wmap'.
|
||||
|
|
1
array.c
1
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 */
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче