ruby-changes:40719
From: usa <ko1@a...>
Date: Mon, 30 Nov 2015 21:12:51 +0900 (JST)
Subject: [ruby-changes:40719] usa:r52798 (ruby_2_1): merge revision(s) 51488, 51489: [Backport #11416]
usa 2015-11-30 21:12:33 +0900 (Mon, 30 Nov 2015) New Revision: 52798 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52798 Log: merge revision(s) 51488,51489: [Backport #11416] * transcode.c (rb_econv_open0): rb_econv_t::source_encoding_name and rb_econv_t::destination_encoding_name should refer static strings always or NULL. [ruby-core:70247] [Bug #11416] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/transcode.c branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 52797) +++ ruby_2_1/ChangeLog (revision 52798) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Mon Nov 30 21:09:48 2015 Nobuyoshi Nakada <nobu@r...> + + * transcode.c (rb_econv_open0): rb_econv_t::source_encoding_name + and rb_econv_t::destination_encoding_name should refer static + strings always or NULL. [ruby-core:70247] [Bug #11416] + Mon Nov 30 21:02:21 2015 NARUSE, Yui <naruse@r...> * ext/digest/*/*.[ch]: include ruby.h before digest.h to avoid Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 52797) +++ ruby_2_1/version.h (revision 52798) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.8" #define RUBY_RELEASE_DATE "2015-11-30" -#define RUBY_PATCHLEVEL 423 +#define RUBY_PATCHLEVEL 424 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_1/transcode.c =================================================================== --- ruby_2_1/transcode.c (revision 52797) +++ ruby_2_1/transcode.c (revision 52798) @@ -995,6 +995,7 @@ rb_econv_open0(const char *sname, const https://github.com/ruby/ruby/blob/trunk/ruby_2_1/transcode.c#L995 if (*sname == '\0' && *dname == '\0') { num_trans = 0; entries = NULL; + sname = dname = ""; } else { struct trans_open_t toarg; @@ -3248,10 +3249,10 @@ rb_econv_init_by_convpath(VALUE self, VA https://github.com/ruby/ruby/blob/trunk/ruby_2_1/transcode.c#L3249 } if (first) { - *senc_p = NULL; - *denc_p = NULL; - *sname_p = ""; - *dname_p = ""; + *senc_p = NULL; + *denc_p = NULL; + *sname_p = ""; + *dname_p = ""; } ec->source_encoding_name = *sname_p; @@ -3392,7 +3393,10 @@ econv_init(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_1/transcode.c#L3393 } if (!ec) { - rb_exc_raise(rb_econv_open_exc(sname, dname, ecflags)); + VALUE exc = rb_econv_open_exc(sname, dname, ecflags); + RB_GC_GUARD(snamev); + RB_GC_GUARD(dnamev); + rb_exc_raise(exc); } if (!DECORATOR_P(sname, dname)) { @@ -3400,6 +3404,8 @@ econv_init(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_1/transcode.c#L3404 senc = make_dummy_encoding(sname); if (!denc) denc = make_dummy_encoding(dname); + RB_GC_GUARD(snamev); + RB_GC_GUARD(dnamev); } ec->source_encoding = senc; Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r51488-51489 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/