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

ruby-changes:34500

From: usa <ko1@a...>
Date: Fri, 27 Jun 2014 17:27:56 +0900 (JST)
Subject: [ruby-changes:34500] usa:r46581 (ruby_2_0_0): merge revision(s) 46075: [Backport #9856]

usa	2014-06-27 17:27:46 +0900 (Fri, 27 Jun 2014)

  New Revision: 46581

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

  Log:
    merge revision(s) 46075: [Backport #9856]
    
    * process.c (proc_getgroups, proc_setgroups): use ALLOCV_N
      [Bug #9856]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/process.c
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 46580)
+++ ruby_2_0_0/ChangeLog	(revision 46581)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Jun 27 17:27:26 2014  Eric Wong  <e@8...>
+
+	* process.c (proc_getgroups, proc_setgroups): use ALLOCV_N
+	  [Bug #9856]
+
 Fri Jun 27 17:19:22 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (io_setstrbuf): always check if the buffer is modifiable.
Index: ruby_2_0_0/process.c
===================================================================
--- ruby_2_0_0/process.c	(revision 46580)
+++ ruby_2_0_0/process.c	(revision 46581)
@@ -5548,7 +5548,7 @@ maxgroups(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/process.c#L5548
 static VALUE
 proc_getgroups(VALUE obj)
 {
-    VALUE ary;
+    VALUE ary, tmp;
     int i, ngroups;
     rb_gid_t *groups;
 
@@ -5556,7 +5556,7 @@ proc_getgroups(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/process.c#L5556
     if (ngroups == -1)
 	rb_sys_fail(0);
 
-    groups = ALLOCA_N(rb_gid_t, ngroups);
+    groups = ALLOCV_N(rb_gid_t, tmp, ngroups);
 
     ngroups = getgroups(ngroups, groups);
     if (ngroups == -1)
@@ -5566,6 +5566,8 @@ proc_getgroups(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/process.c#L5566
     for (i = 0; i < ngroups; i++)
 	rb_ary_push(ary, GIDT2NUM(groups[i]));
 
+    ALLOCV_END(tmp);
+
     return ary;
 }
 #else
@@ -5592,6 +5594,7 @@ proc_setgroups(VALUE obj, VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/process.c#L5594
 {
     int ngroups, i;
     rb_gid_t *groups;
+    VALUE tmp;
     PREPARE_GETGRNAM;
 
     Check_Type(ary, T_ARRAY);
@@ -5600,7 +5603,7 @@ proc_setgroups(VALUE obj, VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/process.c#L5603
     if (ngroups > maxgroups())
 	rb_raise(rb_eArgError, "too many groups, %d max", maxgroups());
 
-    groups = ALLOCA_N(rb_gid_t, ngroups);
+    groups = ALLOCV_N(rb_gid_t, tmp, ngroups);
 
     for (i = 0; i < ngroups; i++) {
 	VALUE g = RARRAY_PTR(ary)[i];
@@ -5612,6 +5615,8 @@ proc_setgroups(VALUE obj, VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/process.c#L5615
     if (setgroups(ngroups, groups) == -1) /* ngroups <= maxgroups */
 	rb_sys_fail(0);
 
+    ALLOCV_END(tmp);
+
     return proc_getgroups(obj);
 }
 #else
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 46580)
+++ ruby_2_0_0/version.h	(revision 46581)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-06-27"
-#define RUBY_PATCHLEVEL 505
+#define RUBY_PATCHLEVEL 506
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 6

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r46075


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

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