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

ruby-changes:35251

From: usa <ko1@a...>
Date: Sun, 31 Aug 2014 16:11:38 +0900 (JST)
Subject: [ruby-changes:35251] usa:r47333 (ruby_2_0_0): merge revision(s) 46368, 46371: [Backport #9913]

usa	2014-08-31 16:11:29 +0900 (Sun, 31 Aug 2014)

  New Revision: 47333

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

  Log:
    merge revision(s) 46368,46371: [Backport #9913]
    
    * ext/digest/digest.c (rb_digest_instance_equal):
      fix #== for non-string arguments. [ruby-core:62967] [Bug #9913]
    
    * test/digest/test_digest.rb: add test for above.
    
    * ext/digest/digest.c (rb_digest_instance_equal): no need to call
      `to_s` twice.  [Bug #9913]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/ext/digest/digest.c
    branches/ruby_2_0_0/test/digest/test_digest.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 47332)
+++ ruby_2_0_0/ChangeLog	(revision 47333)
@@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Aug 31 16:10:30 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/digest/digest.c (rb_digest_instance_equal): no need to call
+	  `to_s` twice.  [Bug #9913]
+
+Sun Aug 31 16:10:30 2014  Benoit Daloze  <eregontp@g...>
+
+	* ext/digest/digest.c (rb_digest_instance_equal):
+	  fix #== for non-string arguments. [ruby-core:62967] [Bug #9913]
+
+	* test/digest/test_digest.rb: add test for above.
+
 Sun Aug 31 15:46:23 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* array.c (yield_indexed_values): extract from permute0(),
Index: ruby_2_0_0/ext/digest/digest.c
===================================================================
--- ruby_2_0_0/ext/digest/digest.c	(revision 47332)
+++ ruby_2_0_0/ext/digest/digest.c	(revision 47333)
@@ -356,7 +356,8 @@ rb_digest_instance_equal(VALUE self, VAL https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ext/digest/digest.c#L356
         str2 = rb_digest_instance_digest(0, 0, other);
     } else {
         str1 = rb_digest_instance_to_s(self);
-        str2 = other;
+        str2 = rb_check_string_type(other);
+        if (NIL_P(str2)) return Qfalse;
     }
 
     /* never blindly assume that subclass methods return strings */
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 47332)
+++ ruby_2_0_0/version.h	(revision 47333)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-08-31"
-#define RUBY_PATCHLEVEL 533
+#define RUBY_PATCHLEVEL 534
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_0_0/test/digest/test_digest.rb
===================================================================
--- ruby_2_0_0/test/digest/test_digest.rb	(revision 47332)
+++ ruby_2_0_0/test/digest/test_digest.rb	(revision 47333)
@@ -68,6 +68,9 @@ module TestDigest https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/digest/test_digest.rb#L68
 
     assert_equal(md1, md1.clone, self.class::ALGO)
 
+    bug9913 = '[ruby-core:62967] [Bug #9913]'
+    assert_not_equal(md1, nil, bug9913)
+
     md2 = self.class::ALGO.new
     md2 << "A"
 

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r46368,46371


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

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