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

ruby-changes:49830

From: shyouhei <ko1@a...>
Date: Fri, 19 Jan 2018 16:17:02 +0900 (JST)
Subject: [ruby-changes:49830] shyouhei:r61948 (trunk): svn merge -c -61947 .

shyouhei	2018-01-19 16:16:54 +0900 (Fri, 19 Jan 2018)

  New Revision: 61948

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61948

  Log:
    svn merge -c -61947 .
    
    Previous commit fails in CI.

  Modified files:
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 61947)
+++ array.c	(revision 61948)
@@ -5064,6 +5064,8 @@ rb_ary_cycle(int argc, VALUE *argv, VALU https://github.com/ruby/ruby/blob/trunk/array.c#L5064
     return Qnil;
 }
 
+#define tmpbuf(n, size) rb_str_tmp_new((n)*(size))
+#define tmpbuf_discard(s) (rb_str_resize((s), 0L), RBASIC_SET_CLASS_RAW(s, rb_cString))
 #define tmpary(n) rb_ary_tmp_new(n)
 #define tmpary_discard(a) (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray))
 
@@ -5566,9 +5568,9 @@ rb_ary_product(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/array.c#L5568
 {
     int n = argc+1;    /* How many arrays we're operating on */
     volatile VALUE t0 = tmpary(n);
-    volatile VALUE t1 = Qundef;
+    volatile VALUE t1 = tmpbuf(n, sizeof(int));
     VALUE *arrays = RARRAY_PTR(t0); /* The arrays we're computing the product of */
-    int *counters = ALLOCV_N(int, t1, n); /* The current position in each one */
+    int *counters = (int*)RSTRING_PTR(t1); /* The current position in each one */
     VALUE result = Qnil;      /* The array we'll be returning, when no block given */
     long i,j;
     long resultlen = 1;
@@ -5645,7 +5647,7 @@ rb_ary_product(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/array.c#L5647
     }
 done:
     tmpary_discard(t0);
-    ALLOCV_END(t1);
+    tmpbuf_discard(t1);
 
     return NIL_P(result) ? ary : result;
 }

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

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