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

ruby-changes:29965

From: usa <ko1@a...>
Date: Wed, 17 Jul 2013 11:01:55 +0900 (JST)
Subject: [ruby-changes:29965] usa:r42017 (ruby_1_9_3): merge revision(s) 36265: [Backport #8580]

usa	2013-07-17 11:01:42 +0900 (Wed, 17 Jul 2013)

  New Revision: 42017

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

  Log:
    merge revision(s) 36265: [Backport #8580]
    
    * ext/date/date_core.c: [ruby-core:46058].

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/date/date_core.c
    branches/ruby_1_9_3/test/date/test_switch_hitter.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 42016)
+++ ruby_1_9_3/ChangeLog	(revision 42017)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Wed Jul 17 11:00:21 2013  Tadayoshi Funaba  <tadf@d...>
+
+	* ext/date/date_core.c: [ruby-core:46058].
+
 Wed Jul 17 10:14:37 2013  Martin Bosslet  <Martin.Bosslet@g...>
 
 	* lib/openssl/ssl-internal.rb: Fix SSL client connection crash for SAN
Index: ruby_1_9_3/ext/date/date_core.c
===================================================================
--- ruby_1_9_3/ext/date/date_core.c	(revision 42016)
+++ ruby_1_9_3/ext/date/date_core.c	(revision 42017)
@@ -991,8 +991,14 @@ safe_mul_p(VALUE x, long m) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ext/date/date_core.c#L991
     if (!FIXNUM_P(x))
 	return 0;
     ix = FIX2LONG(x);
-    if (ix >= (FIXNUM_MAX / m))
-	return 0;
+    if (ix < 0) {
+	if (ix <= (FIXNUM_MIN / m))
+	    return 0;
+    }
+    else {
+	if (ix >= (FIXNUM_MAX / m))
+	    return 0;
+    }
     return 1;
 }
 
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 42016)
+++ ruby_1_9_3/version.h	(revision 42017)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 454
+#define RUBY_PATCHLEVEL 455
 
 #define RUBY_RELEASE_DATE "2013-07-17"
 #define RUBY_RELEASE_YEAR 2013
Index: ruby_1_9_3/test/date/test_switch_hitter.rb
===================================================================
--- ruby_1_9_3/test/date/test_switch_hitter.rb	(revision 42016)
+++ ruby_1_9_3/test/date/test_switch_hitter.rb	(revision 42017)
@@ -294,6 +294,8 @@ class TestSH < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/date/test_switch_hitter.rb#L294
     assert_raise(Errno::ERANGE) do
       Date.new(1 << 10000).strftime('%Y') 
     end
+    assert_equal('-3786825600', Date.new(1850).strftime('%s'))
+    assert_equal('-3786825600000', Date.new(1850).strftime('%Q'))
   end
 
   def test_cmp

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r36265


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

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