ruby-changes:34534
From: nagachika <ko1@a...>
Date: Mon, 30 Jun 2014 02:43:08 +0900 (JST)
Subject: [ruby-changes:34534] nagachika:r46615 (ruby_2_1): merge revision(s) r46075: [Backport #9856]
nagachika 2014-06-30 02:43:01 +0900 (Mon, 30 Jun 2014) New Revision: 46615 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46615 Log: merge revision(s) r46075: [Backport #9856] * process.c (proc_getgroups, proc_setgroups): use ALLOCV_N [Bug #9856] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/process.c branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46614) +++ ruby_2_1/ChangeLog (revision 46615) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Mon Jun 30 02:36:08 2014 Eric Wong <e@8...> + + * process.c (proc_getgroups, proc_setgroups): use ALLOCV_N + [Bug #9856] + Mon Jun 30 02:28:10 2014 Nobuyoshi Nakada <nobu@r...> * io.c (io_setstrbuf): always check if the buffer is modifiable. Index: ruby_2_1/process.c =================================================================== --- ruby_2_1/process.c (revision 46614) +++ ruby_2_1/process.c (revision 46615) @@ -5662,7 +5662,7 @@ maxgroups(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/process.c#L5662 static VALUE proc_getgroups(VALUE obj) { - VALUE ary; + VALUE ary, tmp; int i, ngroups; rb_gid_t *groups; @@ -5670,7 +5670,7 @@ proc_getgroups(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/process.c#L5670 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) @@ -5680,6 +5680,8 @@ proc_getgroups(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/process.c#L5680 for (i = 0; i < ngroups; i++) rb_ary_push(ary, GIDT2NUM(groups[i])); + ALLOCV_END(tmp); + return ary; } #else @@ -5706,6 +5708,7 @@ proc_setgroups(VALUE obj, VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/process.c#L5708 { int ngroups, i; rb_gid_t *groups; + VALUE tmp; PREPARE_GETGRNAM; Check_Type(ary, T_ARRAY); @@ -5714,7 +5717,7 @@ proc_setgroups(VALUE obj, VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/process.c#L5717 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_AREF(ary, i); @@ -5726,6 +5729,8 @@ proc_setgroups(VALUE obj, VALUE ary) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/process.c#L5729 if (setgroups(ngroups, groups) == -1) /* ngroups <= maxgroups */ rb_sys_fail(0); + ALLOCV_END(tmp); + return proc_getgroups(obj); } #else Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46614) +++ ruby_2_1/version.h (revision 46615) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-06-30" -#define RUBY_PATCHLEVEL 152 +#define RUBY_PATCHLEVEL 153 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 6 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r46075 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/