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

ruby-changes:35400

From: nagachika <ko1@a...>
Date: Wed, 10 Sep 2014 03:10:29 +0900 (JST)
Subject: [ruby-changes:35400] nagachika:r47482 (ruby_2_1): merge revision(s) r47196: [Backport #10144]

nagachika	2014-09-10 03:10:18 +0900 (Wed, 10 Sep 2014)

  New Revision: 47482

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

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

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/time.c
    branches/ruby_2_1/version.h
Index: ruby_2_1/time.c
===================================================================
--- ruby_2_1/time.c	(revision 47481)
+++ ruby_2_1/time.c	(revision 47482)
@@ -2350,6 +2350,10 @@ time_timespec(VALUE num, int interval) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/time.c#L2350
 	    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_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 47481)
+++ ruby_2_1/ChangeLog	(revision 47482)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Wed Sep 10 03:01:31 2014  Eric Wong  <e@8...>
+
+	* time.c (time_timespec): fix tv_nsec overflow
+	  [Bug #10144]
+
 Wed Sep 10 02:51:38 2014  Koichi Sasada  <ko1@a...>
 
 	* iseq.c (rb_iseq_clone): Should not insert write barrier from
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 47481)
+++ ruby_2_1/version.h	(revision 47482)
@@ -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-09-10"
-#define RUBY_PATCHLEVEL 229
+#define RUBY_PATCHLEVEL 230
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 9

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


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

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