[前][次][番号順一覧][スレッド一覧]

ruby-changes:29156

From: ko1 <ko1@a...>
Date: Mon, 10 Jun 2013 16:23:55 +0900 (JST)
Subject: [ruby-changes:29156] ko1:r41208 (trunk): * array.c (rb_ary_new_from_values): add assertion

ko1	2013-06-10 16:23:36 +0900 (Mon, 10 Jun 2013)

  New Revision: 41208

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41208

  Log:
    * array.c (rb_ary_new_from_values): add assertion
      (ary should be young object).

  Modified files:
    trunk/ChangeLog
    trunk/array.c

Index: array.c
===================================================================
--- array.c	(revision 41207)
+++ array.c	(revision 41208)
@@ -456,6 +456,7 @@ rb_ary_new_from_values(long n, const VAL https://github.com/ruby/ruby/blob/trunk/array.c#L456
 
     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 */
 	});
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41207)
+++ ChangeLog	(revision 41208)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jun 10 16:22:50 2013  Koichi Sasada  <ko1@a...>
+
+	* array.c (rb_ary_new_from_values): add assertion
+	  (ary should be young object).
+
 Mon Jun 10 16:05:59 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (wmap_mark): check allocation of `w->obj2wmap'.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]