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

ruby-changes:32274

From: hone <ko1@a...>
Date: Mon, 23 Dec 2013 08:41:26 +0900 (JST)
Subject: [ruby-changes:32274] hone:r44353 (ruby_1_9_2): merge revision(s) 43775: [Fixes GH-458]

hone	2013-12-23 08:41:16 +0900 (Mon, 23 Dec 2013)

  New Revision: 44353

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

  Log:
    merge revision(s) 43775: [Fixes GH-458]
    https://github.com/ruby/ruby/pull/458
    
       * util.c (ruby_strtod): ignore too long fraction part, which does not
         affect the result.

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/util.c
    branches/ruby_1_9_2/version.h
Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 44352)
+++ ruby_1_9_2/ChangeLog	(revision 44353)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/ChangeLog#L1
+Fri Nov 22 12:43:52 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* util.c (ruby_strtod): ignore too long fraction part, which does not
+	  affect the result.
+
 Mon Apr 15 14:57:43 2013  NARUSE, Yui  <naruse@r...>
 
 	* ext/json/parser/parser.rl (json_string_unescape): workaround fix
Index: ruby_1_9_2/util.c
===================================================================
--- ruby_1_9_2/util.c	(revision 44352)
+++ ruby_1_9_2/util.c	(revision 44353)
@@ -852,6 +852,11 @@ extern void *MALLOC(size_t); https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/util.c#L852
 #else
 #define MALLOC malloc
 #endif
+#ifdef FREE
+extern void FREE(void*);
+#else
+#define FREE free
+#endif
 
 #ifndef Omit_Private_Memory
 #ifndef PRIVATE_MEM
@@ -1142,7 +1147,7 @@ Balloc(int k) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/util.c#L1147
 #endif
 
     ACQUIRE_DTOA_LOCK(0);
-    if ((rv = freelist[k]) != 0) {
+    if (k <= Kmax && (rv = freelist[k]) != 0) {
         freelist[k] = rv->next;
     }
     else {
@@ -1152,7 +1157,7 @@ Balloc(int k) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/util.c#L1157
 #else
         len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
                 /sizeof(double);
-        if (pmem_next - private_mem + len <= PRIVATE_mem) {
+        if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
             rv = (Bigint*)pmem_next;
             pmem_next += len;
         }
@@ -1171,6 +1176,10 @@ static void https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/util.c#L1176
 Bfree(Bigint *v)
 {
     if (v) {
+        if (v->k > Kmax) {
+            FREE(v);
+            return;
+        }
         ACQUIRE_DTOA_LOCK(0);
         v->next = freelist[v->k];
         freelist[v->k] = v;
@@ -2212,6 +2221,7 @@ break2: https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/util.c#L2221
         for (; c >= '0' && c <= '9'; c = *++s) {
 have_dig:
             nz++;
+            if (nf > DBL_DIG * 2) continue;
             if (c -= '0') {
                 nf += nz;
                 for (i = 1; i < nz; i++)
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 44352)
+++ ruby_1_9_2/version.h	(revision 44353)
@@ -1,13 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_2/version.h#L1
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 325
+#define RUBY_PATCHLEVEL 326
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
 
 #define RUBY_RELEASE_YEAR 2013
-#define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 15
-#define RUBY_RELEASE_DATE "2013-04-15"
+#define RUBY_RELEASE_MONTH 12
+#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_DATE "2013-12-23"
 
 #include "ruby/version.h"
 

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

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