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

ruby-changes:26753

From: naruse <ko1@a...>
Date: Mon, 14 Jan 2013 06:54:51 +0900 (JST)
Subject: [ruby-changes:26753] naruse:r38805 (trunk): * regparse.c (add_ctype_to_cc): don't check dup warn on adding

naruse	2013-01-14 06:51:37 +0900 (Mon, 14 Jan 2013)

  New Revision: 38805

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

  Log:
    * regparse.c (add_ctype_to_cc): don't check dup warn on adding
      negative ctype to cclass. [Bug #7471] [ruby-core:50344]

  Modified files:
    trunk/ChangeLog
    trunk/regparse.c
    trunk/test/ruby/test_regexp.rb

Index: regparse.c
===================================================================
--- regparse.c	(revision 38804)
+++ regparse.c	(revision 38805)
@@ -4127,7 +4127,7 @@ add_ctype_to_cc(CClassNode* cc, int ctyp https://github.com/ruby/ruby/blob/trunk/regparse.c#L4127
     r = add_ctype_to_cc_by_range(cc, ctype, not, env, sb_out, ranges);
     if ((r == 0) && ascii_range) {
       if (not != 0) {
-	r = add_code_range_to_buf(&(cc->mbuf), env, 0x80, ONIG_LAST_CODE_POINT);
+	r = add_code_range_to_buf0(&(cc->mbuf), env, 0x80, ONIG_LAST_CODE_POINT, FALSE);
       }
       else {
 	CClassNode ccascii;
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38804)
+++ ChangeLog	(revision 38805)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jan 14 06:46:53 2013  NARUSE, Yui  <naruse@r...>
+
+	* regparse.c (add_ctype_to_cc): don't check dup warn on adding
+	  negative ctype to cclass. [Bug #7471] [ruby-core:50344]
+
 Mon Jan 14 06:06:03 2013  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/matrix/eigenvalue_decomposition: Backport bugfix of Jama 1.0.3
Index: test/ruby/test_regexp.rb
===================================================================
--- test/ruby/test_regexp.rb	(revision 38804)
+++ test/ruby/test_regexp.rb	(revision 38805)
@@ -906,6 +906,11 @@ class TestRegexp < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_regexp.rb#L906
     assert_warning(/duplicated/) { Regexp.new('[\u1000-\u2000\u3042-\u3046\u3044]') }
     assert_warning(/duplicated/) { Regexp.new('[\u3044\u3041-\u3047]') }
     assert_warning(/duplicated/) { Regexp.new('[\u3042\u3044\u3046\u3041-\u3047]') }
+
+    bug7471 = '[ruby-core:50344]'
+    EnvUtil.verbose_warning do
+      assert_warning(/\A\z/, bug7471) { Regexp.new('[\D]') =~ "\u3042" }
+    end
   end
 
   def test_property_warn

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

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