ruby-changes:34726
From: nagachika <ko1@a...>
Date: Sun, 13 Jul 2014 23:24:34 +0900 (JST)
Subject: [ruby-changes:34726] nagachika:r46809 (ruby_2_1): merge revision(s) r46368, r46371: [Backport #9913]
nagachika 2014-07-13 23:24:26 +0900 (Sun, 13 Jul 2014) New Revision: 46809 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46809 Log: merge revision(s) r46368,r46371: [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_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/ext/digest/digest.c branches/ruby_2_1/test/digest/test_digest.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46808) +++ ruby_2_1/ChangeLog (revision 46809) @@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Sun Jul 13 23:18:11 2014 Nobuyoshi Nakada <nobu@r...> + + * ext/digest/digest.c (rb_digest_instance_equal): no need to call + `to_s` twice. [Bug #9913] + +Sun Jul 13 23:18:11 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 Jul 13 23:10:03 2014 Nobuyoshi Nakada <nobu@r...> * array.c (yield_indexed_values): extract from permute0(), Index: ruby_2_1/ext/digest/digest.c =================================================================== --- ruby_2_1/ext/digest/digest.c (revision 46808) +++ ruby_2_1/ext/digest/digest.c (revision 46809) @@ -372,7 +372,8 @@ rb_digest_instance_equal(VALUE self, VAL https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/digest/digest.c#L372 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_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46808) +++ ruby_2_1/version.h (revision 46809) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-07-13" -#define RUBY_PATCHLEVEL 173 +#define RUBY_PATCHLEVEL 174 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 7 Index: ruby_2_1/test/digest/test_digest.rb =================================================================== --- ruby_2_1/test/digest/test_digest.rb (revision 46808) +++ ruby_2_1/test/digest/test_digest.rb (revision 46809) @@ -69,6 +69,9 @@ module TestDigest https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/digest/test_digest.rb#L69 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_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r46368,46371 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/