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

ruby-changes:49338

From: nagachika <ko1@a...>
Date: Mon, 25 Dec 2017 04:14:38 +0900 (JST)
Subject: [ruby-changes:49338] nagachika:r61455 (ruby_2_4): merge revision(s) 60066: [Backport #13952]

nagachika	2017-12-25 04:14:30 +0900 (Mon, 25 Dec 2017)

  New Revision: 61455

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

  Log:
    merge revision(s) 60066: [Backport #13952]
    
    string.c: fix ASCII-only on succ
    
    * string.c (str_succ): clear coderange cache when no alpha-numeric
      character case, carried part may become ASCII-only.
      [ruby-core:83062] [Bug #13952]

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/string.c
    branches/ruby_2_4/test/ruby/test_string.rb
    branches/ruby_2_4/version.h
Index: ruby_2_4/string.c
===================================================================
--- ruby_2_4/string.c	(revision 61454)
+++ ruby_2_4/string.c	(revision 61455)
@@ -3969,6 +3969,7 @@ str_succ(VALUE str) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/string.c#L3969
             }
             carry_pos = s - sbeg;
 	}
+	ENC_CODERANGE_SET(str, ENC_CODERANGE_UNKNOWN);
     }
     RESIZE_CAPA(str, slen + carry_len);
     sbeg = RSTRING_PTR(str);
Index: ruby_2_4/test/ruby/test_string.rb
===================================================================
--- ruby_2_4/test/ruby/test_string.rb	(revision 61454)
+++ ruby_2_4/test/ruby/test_string.rb	(revision 61455)
@@ -1660,6 +1660,11 @@ CODE https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_string.rb#L1660
 
     assert_equal("!", " ".succ)
     assert_equal("", "".succ)
+
+    bug = '[ruby-core:83062] [Bug #13952]'
+    s = "\xff".b
+    assert_not_predicate(s, :ascii_only?)
+    assert_predicate(s.succ, :ascii_only?, bug)
   end
 
   def test_succ!
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 61454)
+++ ruby_2_4/version.h	(revision 61455)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.4"
 #define RUBY_RELEASE_DATE "2017-12-25"
-#define RUBY_PATCHLEVEL 225
+#define RUBY_PATCHLEVEL 226
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 12
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 61454)
+++ ruby_2_4	(revision 61455)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r60066

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

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