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

ruby-changes:34531

From: nagachika <ko1@a...>
Date: Mon, 30 Jun 2014 02:21:39 +0900 (JST)
Subject: [ruby-changes:34531] nagachika:r46612 (ruby_2_1): merge revision(s) r45793: [Backport #9608]

nagachika	2014-06-30 02:21:30 +0900 (Mon, 30 Jun 2014)

  New Revision: 46612

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

  Log:
    merge revision(s) r45793: [Backport #9608]
    
    * complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
      [Bug #9608]
    
    * rational.c (read_digits): ditto

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/complex.c
    branches/ruby_2_1/rational.c
    branches/ruby_2_1/version.h
Index: ruby_2_1/complex.c
===================================================================
--- ruby_2_1/complex.c	(revision 46611)
+++ ruby_2_1/complex.c	(revision 46612)
@@ -1774,19 +1774,26 @@ parse_comp(const char *s, int strict, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/complex.c#L1774
 	   VALUE *num)
 {
     char *buf, *b;
+    VALUE tmp;
+    int ret = 1;
 
-    buf = ALLOCA_N(char, strlen(s) + 1);
+    buf = ALLOCV_N(char, tmp, strlen(s) + 1);
     b = buf;
 
     skip_ws(&s);
-    if (!read_comp(&s, strict, num, &b))
-	return 0;
-    skip_ws(&s);
+    if (!read_comp(&s, strict, num, &b)) {
+	ret = 0;
+    }
+    else {
+	skip_ws(&s);
+
+	if (strict)
+	    if (*s != '\0')
+		ret = 0;
+    }
+    ALLOCV_END(tmp);
 
-    if (strict)
-	if (*s != '\0')
-	    return 0;
-    return 1;
+    return ret;
 }
 
 static VALUE
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 46611)
+++ ruby_2_1/ChangeLog	(revision 46612)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon Jun 30 02:18:47 2014  Eric Wong  <e@8...>
+
+	* complex.c (parse_comp): replace ALLOCA_N with ALLOCV_N/ALLOCV_END
+	  [Bug #9608]
+	* rational.c (read_digits): ditto
+
 Mon Jun 30 02:10:34 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* vsnprintf.c (BSD_vfprintf): fix string width when precision is
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 46611)
+++ ruby_2_1/version.h	(revision 46612)
@@ -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-06-30"
-#define RUBY_PATCHLEVEL 149
+#define RUBY_PATCHLEVEL 150
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 6
Index: ruby_2_1/rational.c
===================================================================
--- ruby_2_1/rational.c	(revision 46611)
+++ ruby_2_1/rational.c	(revision 46612)
@@ -2167,13 +2167,14 @@ read_digits(const char **s, int strict, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/rational.c#L2167
 {
     char *b, *bb;
     int us = 1, ret = 1;
+    VALUE tmp;
 
     if (!isdecimal(**s)) {
 	*num = ZERO;
 	return 0;
     }
 
-    bb = b = ALLOCA_N(char, strlen(*s) + 1);
+    bb = b = ALLOCV_N(char, tmp, strlen(*s) + 1);
 
     while (isdecimal(**s) || **s == '_') {
 	if (**s == '_') {
@@ -2200,6 +2201,7 @@ read_digits(const char **s, int strict, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/rational.c#L2201
   conv:
     *b = '\0';
     *num = rb_cstr_to_inum(bb, 10, 0);
+    ALLOCV_END(tmp);
     return ret;
 }
 

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


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

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