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

ruby-changes:35419

From: usa <ko1@a...>
Date: Wed, 10 Sep 2014 12:26:33 +0900 (JST)
Subject: [ruby-changes:35419] usa:r47501 (ruby_2_0_0): merge revision(s) 47196: [Backport #10144]

usa	2014-09-10 12:26:21 +0900 (Wed, 10 Sep 2014)

  New Revision: 47501

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

  Log:
    merge revision(s) 47196: [Backport #10144]
    
    * time.c (time_timespec): fix tv_nsec overflow
      [Bug #10144]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/time.c
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/time.c
===================================================================
--- ruby_2_0_0/time.c	(revision 47500)
+++ ruby_2_0_0/time.c	(revision 47501)
@@ -2435,6 +2435,10 @@ time_timespec(VALUE num, int interval) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/time.c#L2435
 	    d = modf(RFLOAT_VALUE(num), &f);
 	    if (d >= 0) {
 		t.tv_nsec = (int)(d*1e9+0.5);
+		if (t.tv_nsec >= 1000000000) {
+		    t.tv_nsec -= 1000000000;
+		    f += 1;
+		}
 	    }
 	    else if ((t.tv_nsec = (int)(-d*1e9+0.5)) > 0) {
 		t.tv_nsec = 1000000000 - t.tv_nsec;
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 47500)
+++ ruby_2_0_0/ChangeLog	(revision 47501)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Wed Sep 10 12:25:24 2014  Eric Wong  <e@8...>
+
+	* time.c (time_timespec): fix tv_nsec overflow
+	  [Bug #10144]
+
 Wed Sep 10 12:21:51 2014  Eric Wong  <e@8...>
 
 	* ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 47500)
+++ ruby_2_0_0/version.h	(revision 47501)
@@ -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-09-10"
-#define RUBY_PATCHLEVEL 562
+#define RUBY_PATCHLEVEL 563
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 9

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r47196


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

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