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

ruby-changes:40705

From: nagachika <ko1@a...>
Date: Sun, 29 Nov 2015 16:44:22 +0900 (JST)
Subject: [ruby-changes:40705] nagachika:r52784 (ruby_2_2): merge revision(s) 51488, 51489: [Backport #11416]

nagachika	2015-11-29 16:44:09 +0900 (Sun, 29 Nov 2015)

  New Revision: 52784

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

  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_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/transcode.c
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 52783)
+++ ruby_2_2/ChangeLog	(revision 52784)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Sun Nov 29 16:33:30 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]
+
 Sun Nov 29 16:11:32 2015  Eric Wong  <e@8...>
 
 	* iseq.c (iseq_data_to_ary): dump kw_arg as symbol
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 52783)
+++ ruby_2_2/version.h	(revision 52784)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.4"
 #define RUBY_RELEASE_DATE "2015-11-29"
-#define RUBY_PATCHLEVEL 209
+#define RUBY_PATCHLEVEL 210
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 11
Index: ruby_2_2/transcode.c
===================================================================
--- ruby_2_2/transcode.c	(revision 52783)
+++ ruby_2_2/transcode.c	(revision 52784)
@@ -993,6 +993,7 @@ rb_econv_open0(const char *sname, const https://github.com/ruby/ruby/blob/trunk/ruby_2_2/transcode.c#L993
     if (*sname == '\0' && *dname == '\0') {
         num_trans = 0;
         entries = NULL;
+	sname = dname = "";
     }
     else {
         struct trans_open_t toarg;
@@ -3246,10 +3247,10 @@ rb_econv_init_by_convpath(VALUE self, VA https://github.com/ruby/ruby/blob/trunk/ruby_2_2/transcode.c#L3247
     }
 
     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;
@@ -3390,7 +3391,10 @@ econv_init(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_2/transcode.c#L3391
     }
 
     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)) {
@@ -3398,6 +3402,8 @@ econv_init(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_2/transcode.c#L3402
             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_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r51488-51489


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

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